nacos连接数据库区分开发、测试、生产环境

This commit is contained in:
yuanly committed 2022-05-20 13:59:11 +08:00
1 parent 7b0487f2d9
commit f9c924f9b6
4 files changed
+155 -50

No files matched your search

@@ -0,0 +1,51 @@
server:
port: 8848
tomcat:
basedir: logs
db:
num: 1
user: ${MYSQL_USER:root}
password: ${MYSQL_PWD:root}
url:
0: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
nacos:
core:
auth:
system.type: nacos
default.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
security:
ignore:
urls: /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
spring:
datasource:
platform: mysql #这个过期属性不能修改,nacos 代码对此有硬编码
security:
enabled: true
boot: # 接入 spring boot admin
admin:
client:
url: http://pigx-monitor:5001
username: pig
password: pig
instance:
prefer-ip: true
application:
name: @project.artifactId@
useAddressServer: true
management:
endpoints:
web:
exposure:
include: '*'
metrics:
export:
influx:
enabled: false
elastic:
enabled: false
@@ -0,0 +1,51 @@
server:
port: 8848
tomcat:
basedir: logs
db:
num: 1
user: ${MYSQL_USER:root}
password: ${MYSQL_PWD:root}
url:
0: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
nacos:
core:
auth:
system.type: nacos
default.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
security:
ignore:
urls: /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
spring:
datasource:
platform: mysql #这个过期属性不能修改,nacos 代码对此有硬编码
security:
enabled: true
boot: # 接入 spring boot admin
admin:
client:
url: http://pigx-monitor:5001
username: pig
password: pig
instance:
prefer-ip: true
application:
name: @project.artifactId@
useAddressServer: true
management:
endpoints:
web:
exposure:
include: '*'
metrics:
export:
influx:
enabled: false
elastic:
enabled: false
@@ -0,0 +1,51 @@
server:
port: 8848
tomcat:
basedir: logs
db:
num: 1
user: ${MYSQL_USER:root}
password: ${MYSQL_PWD:root}
url:
0: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
nacos:
core:
auth:
system.type: nacos
default.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
security:
ignore:
urls: /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
spring:
datasource:
platform: mysql #这个过期属性不能修改,nacos 代码对此有硬编码
security:
enabled: true
boot: # 接入 spring boot admin
admin:
client:
url: http://pigx-monitor:5001
username: pig
password: pig
instance:
prefer-ip: true
application:
name: @project.artifactId@
useAddressServer: true
management:
endpoints:
web:
exposure:
include: '*'
metrics:
export:
influx:
enabled: false
elastic:
enabled: false
@@ -1,51 +1,3 @@
server:
port: 8848
tomcat:
basedir: logs
db:
num: 1
user: ${MYSQL_USER:root}
password: ${MYSQL_PWD:root}
url:
0: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
nacos:
core:
auth:
system.type: nacos
default.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
security:
ignore:
urls: /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
spring:
datasource:
platform: mysql #这个过期属性不能修改,nacos 代码对此有硬编码
security:
enabled: true
boot: # 接入 spring boot admin
admin:
client:
url: http://pigx-monitor:5001
username: pig
password: pig
instance:
prefer-ip: true
application:
name: @project.artifactId@
useAddressServer: true
management:
endpoints:
web:
exposure:
include: '*'
metrics:
export:
influx:
enabled: false
elastic:
enabled: false
profiles:
active: @profiles.active@