nacos配置详解

nacos配置详解

# 设置Nacos的Servlet上下文路径
server.servlet.contextPath=/nacos

# 设置错误页面是否包含详细的错误消息,ALWAYS表示总是包含
server.error.include-message=ALWAYS

# 设置Nacos服务端口
server.port=8848

# 数据库连接URL,这里使用了PostgreSQL数据库
# 包括了数据库的地址、端口、数据库名称和一些连接参数
db.url.0=jdbc:postgresql://127.0.0.1:5432/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
# 数据库用户名
db.user.0=nacos
# 数据库密码
db.password.0=nacos

# 数据库连接池配置
# 连接超时时间
db.pool.config.connectionTimeout=30000
# 验证超时时间
db.pool.config.validationTimeout=10000
# 最大连接池大小
db.pool.config.maximumPoolSize=20
# 最小空闲连接数
db.pool.config.minimumIdle=2

# Nacos配置推送最大重试次数
nacos.config.push.maxRetryTime=50
# Nacos服务清理过期元数据的时间,单位为毫秒
nacos.naming.clean.expired-metadata.expired-time=60000
# Nacos服务推送任务延迟时间,单位为毫秒
nacos.naming.push.pushTaskDelay=500
# Nacos服务推送任务超时时间,单位为毫秒
nacos.naming.push.pushTaskTimeout=5000
# Nacos服务推送任务重试延迟时间,单位为毫秒
nacos.naming.push.pushTaskRetryDelay=1000
# Nacos服务客户端过期时间,单位为毫秒
nacos.naming.client.expired.time=180000

# Nacos CMDB任务间隔时间,单位为秒
# 用于定义CMDB相关任务的调度间隔
nacos.cmdb.dumpTaskInterval=3600
# CMDB事件任务间隔时间,单位为秒
nacos.cmdb.eventTaskInterval=10
# CMDB标签任务间隔时间,单位为秒
nacos.cmdb.labelTaskInterval=300
# 是否在启动时加载Nacos CMDB数据
nacos.cmdb.loadDataAtStart=false

# Tomcat MBeanRegistry是否启用
server.tomcat.mbeanregistry.enabled=true

# 管理端点暴露包含的端点
management.endpoints.web.exposure.include=prometheus,health

# 管理端点指标导出到Elasticsearch的配置
# 是否启用Elasticsearch指标导出
management.metrics.export.elastic.enabled=false
# Elasticsearch主机地址
management.metrics.export.elastic.host=http://localhost:9200

# 管理端点指标导出到InfluxDB的配置
# 是否启用InfluxDB指标导出
management.metrics.export.influx.enabled=false
# InfluxDB数据库名称
management.metrics.export.influx.db=springboot
# InfluxDB URI
management.metrics.export.influx.uri=http://localhost:8086
# 是否自动创建InfluxDB数据库
management.metrics.export.influx.auto-create-db=true
# 一致性级别
management.metrics.export.influx.consistency=one
# 是否压缩传输
management.metrics.export.influx.compressed=true

# Tomcat访问日志配置
server.tomcat.accesslog.enabled=true
server.tomcat.accesslog.rotate=true
server.tomcat.accesslog.file-date-format=.yyyy-MM-dd-HH
# 访问日志格式配置
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i

# 禁用Spring Security
spring.security.enabled=false

# 安全忽略的URL列表,多个URL使用逗号分隔
nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**

# LDAP配置
# LDAP服务器URL
nacos.core.auth.ldap.url=ldap://localhost:389
# LDAP基础DN
nacos.core.auth.ldap.basedc=dc=example,dc=org
# LDAP管理员DN
nacos.core.auth.ldap.userDn=cn=admin,${nacos.core.auth.ldap.basedc}
# LDAP管理员密码
nacos.core.auth.ldap.password=admin
# LDAP用户DN模板
nacos.core.auth.ldap.userdn=cn={0},dc=example,dc=org
# LDAP过滤器前缀
nacos.core.auth.ldap.filter.prefix=uid
# LDAP大小写敏感
nacos.core.auth.ldap.case.sensitive=true
# 是否忽略LDAP部分结果异常
nacos.core.auth.ldap.ignore.partial.result.exception=false

# 控制管理器类型
nacos.plugin.control.manager.type=nacos
# 控制规则本地基础目录
nacos.plugin.control.rule.local.basedir=${nacos.home}
# 控制规则外部存储
nacos.plugin.control.rule.external.storage=

# 配置插件Webhook是否启用
nacos.core.config.plugin.webhook.enabled=false
# 配置插件Webhook URL
nacos.core.config.plugin.webhook.url=http://localhost:8080/webhook/send?token=***
# 配置插件Webhook内容最大容量,单位为字节
nacos.core.config.plugin.webhook.contentMaxCapacity=102400
# 配置插件白名单是否启用
nacos.core.config.plugin.whitelist.enabled=false
# 配置插件白名单的文件后缀列表,多个后缀使用逗号分隔
nacos.core.config.plugin.whitelist.suffixs=xml,text,properties,yaml,html
# 配置插件文件格式检查是否启用
nacos.core.config.plugin.fileformatcheck.enabled=false

# 是否启用Nacos Istio MCP服务端
nacos.istio.mcp.server.enabled=false

# Snowflake工作节点ID
nacos.core.snowflake.worker-id=

# 成员元数据站点
nacos.core.member.meta.site=
# 成员元数据AD权重
nacos.core.member.meta.adweight=
# 成员元数据权重
nacos.core.member.meta.weight=
# 成员查找类型
nacos.core.member.lookup.type=[file,address-server]
# 成员列表,每个成员包含地址和端口,多个成员使用逗号分隔
nacos.member.list=192.168.16.101:8847?raft_port=8807,192.168.16.101?raft_port=8808,192.168.16.101:8849?raft_port=8809

# 地址服务器重试次数
nacos.core.address-server.retry=5
# 地址服务器域名
address.server.domain=jmenv.tbsite.net
# 地址服务器端口
address.server.port=8080
# 地址服务器URL路径
address.server.url=/nacos/serverlist

# Raft协议数据选举超时时间,单位为毫秒
nacos.core.protocol.raft.data.election_timeout_ms=5000
# Raft协议数据快照间隔时间,单位为秒
nacos.core.protocol.raft.data.snapshot_interval_secs=30
# Raft协议数据核心线程数
nacos.core.protocol.raft.data.core_thread_num=8
# Raft协议数据客户服务线程数
nacos.core.protocol.raft.data.cli_service_thread_num=4
# Raft协议数据读取索引类型
nacos.core.protocol.raft.data.read_index_type=ReadOnlySafe
# Raft协议数据RPC请求超时时间,单位为毫秒
nacos.core.protocol.raft.data.rpc_request_timeout_ms=5000

# 分发协议数据同步延迟时间,单位为毫秒
nacos.core.protocol.distro.data.sync.delayMs=1000
# 分发协议数据同步超时时间,单位为毫秒
nacos.core.protocol.distro.data.sync.timeoutMs=3000
# 分发协议数据同步重试延迟时间,单位为毫秒
nacos.core.protocol.distro.data.sync.retryDelayMs=3000
# 分发协议数据验证间隔时间,单位为毫秒
nacos.core.protocol.distro.data.verify.intervalMs=5000
# 分发协议数据验证超时时间,单位为毫秒
nacos.core.protocol.distro.data.verify.timeoutMs=3000
# 分发协议数据加载重试延迟时间,单位为毫秒
nacos.core.protocol.distro.data.load.retryDelayMs=30000

# 是否启用Prometheus指标
nacos.prometheus.metrics.enabled=true

# 远程服务器gRPC SDK最大入站消息大小,单位为字节
nacos.remote.server.grpc.sdk.max-inbound-message-size=10485760
# 远程服务器gRPC SDK保持活动的时间,单位为毫秒
nacos.remote.server.grpc.sdk.keep-alive-time=7200000
# 远程服务器gRPC SDK保持活动的超时时间,单位为毫秒
nacos.remote.server.grpc.sdk.keep-alive-timeout=20000
# 远程服务器gRPC SDK允许保持活动的时间,单位为毫秒
nacos.remote.server.grpc.sdk.permit-keep-alive-time=300000

# 远程服务器gRPC集群最大入站消息大小,单位为字节
nacos.remote.server.grpc.cluster.max-inbound-message-size=10485760
# 远程服务器gRPC集群保持活动的时间,单位为毫秒
nacos.remote.server.grpc.cluster.keep-alive-time=7200000
# 远程服务器gRPC集群保持活动的超时时间,单位为毫秒
nacos.remote.server.grpc.cluster.keep-alive-timeout=20000
# 远程服务器gRPC集群允许保持活动的时间,单位为毫秒
nacos.remote.server.grpc.cluster.permit-keep-alive-time=300000

# 控制台UI是否启用
nacos.console.ui.enabled=true

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

亦诗亦诗

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值