Files
Work-configuration-file/nacos/application.properties
2025-10-07 15:58:15 +08:00

93 lines
3.1 KiB
Properties
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

########################################
# Nacos 服务基础端口
########################################
# 服务主端口
nacos.server.main.port=8848
# 控制台端口
nacos.console.port=8081
# 控制台访问路径
nacos.server.contextPath=/nacos
########################################
# 数据源配置(使用外部 MySQL
########################################
spring.datasource.platform=mysql
db.num=1
db.url.0=jdbc:mysql://10.0.0.4:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.user=nacos
db.password=s1nGohcFoJs@3h7s
########################################
# Nacos 集群身份识别(必须一致)
########################################
nacos.core.auth.server.identity.key=serverIdentity
nacos.core.auth.server.identity.value=nacos-cluster
########################################
# 启用认证系统JWT配置
########################################
# 开启权限认证
nacos.core.auth.enabled=true
# 开启管理员 API 权限校验
nacos.core.auth.admin.enabled=true
# 开启控制台登录认证
nacos.core.auth.console.enabled=true
# 使用默认 nacos 认证方式
nacos.core.auth.system.type=nacos
# JWT 密钥(长度必须 ≥ 32 字节Base64 编码)
nacos.core.auth.plugin.nacos.token.secret.key=RWZpVfZ7Uu98Edhz93hVdkGEO+3OZkZcXWld5Cz6U54=
# Token 有效期(秒)
nacos.core.auth.plugin.nacos.token.expire.seconds=18000
########################################
# 服务注册配置
########################################
# 自动清理空服务
nacos.naming.empty-service.auto-clean=true
nacos.naming.empty-service.clean.initial-delay-ms=50000
nacos.naming.empty-service.clean.period-time-ms=30000
# 启动时热加载注册信息
nacos.naming.data.warmup=true
# 实例健康检查(过期剔除)
nacos.naming.expireInstance=true
########################################
# 集群相关配置
########################################
# 如使用 cluster.conf请确保存在于 conf/ 目录,格式为 IP:PORT每行一个节点
# 例如:
# 192.168.31.10:8848
# 192.168.31.11:8848
# 192.168.31.12:8848
########################################
# Web 服务配置
########################################
# 启用访问日志
server.tomcat.accesslog.enabled=true
# 保留日志天数
server.tomcat.accesslog.max-days=30
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
server.tomcat.basedir=file:.
########################################
# Spring Boot Actuator 端点暴露
########################################
management.endpoints.web.exposure.include=*
########################################
# 配置推送和重试相关
########################################
nacos.config.push.maxRetryTime=50
########################################
# 控制台 UI 开关
########################################
# nacos.console.ui.enabled=true # 如果要禁用控制台界面,可以启用此项
########################################
# 指标相关配置
########################################
management.endpoints.web.exposure.include=prometheus
management.endpoint.prometheus.enabled=true