區分開發、測試配置

This commit is contained in:
wulin 2023-09-21 20:50:05 +08:00
parent 2e4a629e75
commit a01d410041
12 changed files with 169 additions and 81 deletions

View File

@ -0,0 +1,37 @@
spring:
cloud:
config:
# 如果本地配置优先级高,那么 override-none 设置为 true包括系统环境变量、本地配置文件等配置
override-none: true
# 如果想要远程配置优先级高,那么 allow-override 设置为 false如果想要本地配置优先级高那么 allow-override 设置为 true
allow-override: true
# 只有系统环境变量或者系统属性才能覆盖远程配置文件的配置,本地配置文件中配置优先级低于远程配置;注意本地配置文件不是系统属性
override-system-properties: false
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.8.146:32470
config:
# 配置中心地址
server-addr: 192.168.8.146:32470
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
r2dbc:
#注意下面修改 easyorm相关也需要修改
#url: r2dbc:postgresql://localhost:5432/postgres #postgresql请使用此配置
url: r2dbc:mysql://192.168.8.146:30416/qiuguo_iot?ssl=false&serverZoneId=Asia/Shanghai # mysql请使用此配置
#url: r2dbc:h2:file:///./data/h2db/jetlinks
username: root
password: 123456
redis:
# cluster:
# nodes:
# - 127.0.0.1:7001
# - 127.0.0.1:7002
host: 192.168.8.146
port: 32030
password: 123456
timeout: 5000

View File

@ -0,0 +1,14 @@
spring:
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: iot-nacos.qiuguo-iot:8848
config:
# 配置中心地址
server-addr: iot-nacos.qiuguo-iot:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -1,59 +1,8 @@
server:
port: 8091
port: 8080
spring:
profiles:
# 环境配置
active: dev
application:
name: qiuguo-iot-admin-http-api
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.8.101:8848
config:
# 配置中心地址
server-addr: 192.168.8.101:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
redis:
# cluster:
# nodes:
# - 127.0.0.1:7001
# - 127.0.0.1:7002
host: 192.168.8.101
port: 6379
password: 123456
timeout: 5000
r2dbc:
#注意下面修改 easyorm相关也需要修改
#url: r2dbc:postgresql://localhost:5432/postgres #postgresql请使用此配置
url: r2dbc:mysql://172.24.218.235:3306/qiuguo_iot?ssl=false&serverZoneId=Asia/Shanghai # mysql请使用此配置
#url: r2dbc:h2:file:///./data/h2db/jetlinks
username: root
password: '!pHuRvGKIsbiqcX1'
easyorm:
auto-ddl: false #是否根据实体类型更新数据库字段(增加、属性)
default-schema: qiuguo_iot # 默认使用的schema. mysql时则为数据库名
dialect: mysql # 方言: h2,mysql,postgresql
logging:
config: classpath:logback-${spring.profiles.active}.xml
level:
org.hswebframework: debug
org.hswebframework.expands: error
com.qiuguo.iot.data: debug #可以开启sql的日志打印
hsweb:
cors:
enable: true
configs:
- path: /**
webflux:
response-wrapper:
enabled: true # 将响应结果包装为{"status":200,"result":{}}
excludes: #不包装的类
- org.springdoc
lac: #lac服务地址
url: http://127.0.0.1:8866

View File

@ -0,0 +1,37 @@
spring:
cloud:
config:
# 如果本地配置优先级高,那么 override-none 设置为 true包括系统环境变量、本地配置文件等配置
override-none: true
# 如果想要远程配置优先级高,那么 allow-override 设置为 false如果想要本地配置优先级高那么 allow-override 设置为 true
allow-override: true
# 只有系统环境变量或者系统属性才能覆盖远程配置文件的配置,本地配置文件中配置优先级低于远程配置;注意本地配置文件不是系统属性
override-system-properties: false
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.8.146:32470
config:
# 配置中心地址
server-addr: 192.168.8.146:32470
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
r2dbc:
#注意下面修改 easyorm相关也需要修改
#url: r2dbc:postgresql://localhost:5432/postgres #postgresql请使用此配置
url: r2dbc:mysql://192.168.8.146:30416/qiuguo_iot?ssl=false&serverZoneId=Asia/Shanghai # mysql请使用此配置
#url: r2dbc:h2:file:///./data/h2db/jetlinks
username: root
password: 123456
redis:
# cluster:
# nodes:
# - 127.0.0.1:7001
# - 127.0.0.1:7002
host: 192.168.8.146
port: 32030
password: 123456
timeout: 5000

View File

@ -0,0 +1,14 @@
spring:
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: iot-nacos.qiuguo-iot:8848
config:
# 配置中心地址
server-addr: iot-nacos.qiuguo-iot:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -6,16 +6,3 @@ spring:
active: dev
application:
name: qiuguo-iot-box-user-api
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: iot-nacos.qiuguo-iot:8848
config:
# 配置中心地址
server-addr: iot-nacos.qiuguo-iot:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -0,0 +1,37 @@
spring:
cloud:
config:
# 如果本地配置优先级高,那么 override-none 设置为 true包括系统环境变量、本地配置文件等配置
override-none: true
# 如果想要远程配置优先级高,那么 allow-override 设置为 false如果想要本地配置优先级高那么 allow-override 设置为 true
allow-override: true
# 只有系统环境变量或者系统属性才能覆盖远程配置文件的配置,本地配置文件中配置优先级低于远程配置;注意本地配置文件不是系统属性
override-system-properties: false
nacos:
discovery:
# 服务注册地址
server-addr: 192.168.8.146:32470
config:
# 配置中心地址
server-addr: 192.168.8.146:32470
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
r2dbc:
#注意下面修改 easyorm相关也需要修改
#url: r2dbc:postgresql://localhost:5432/postgres #postgresql请使用此配置
url: r2dbc:mysql://192.168.8.146:30416/qiuguo_iot?ssl=false&serverZoneId=Asia/Shanghai # mysql请使用此配置
#url: r2dbc:h2:file:///./data/h2db/jetlinks
username: root
password: 123456
redis:
# cluster:
# nodes:
# - 127.0.0.1:7001
# - 127.0.0.1:7002
host: 192.168.8.146
port: 32030
password: 123456
timeout: 5000

View File

@ -0,0 +1,14 @@
spring:
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: iot-nacos.qiuguo-iot:8848
config:
# 配置中心地址
server-addr: iot-nacos.qiuguo-iot:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -6,16 +6,3 @@ spring:
active: dev
application:
name: qiuguo-iot-box-websocket
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: iot-nacos.qiuguo-iot:8848
config:
# 配置中心地址
server-addr: iot-nacos.qiuguo-iot:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -2712,3 +2712,7 @@ java.net.ConnectException: no available server, currentServerAddr : http://192.1
18:57:22.363 [Thread-1] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,108] []- [HttpClientBeanHolder] Start destroying common HttpClient
18:57:22.363 [Thread-13] WARN c.a.n.c.n.NotifyCenter - [shutdown,162] []- [NotifyCenter] Destruction of the end
18:57:22.364 [Thread-1] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,114] []- [HttpClientBeanHolder] Destruction of the end
20:48:26.353 [background-preinit] INFO o.h.v.i.util.Version - [<clinit>,21] - HV000001: Hibernate Validator 6.2.5.Final
20:48:28.485 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[qiuguo-iot-box-websocket] & group[DEFAULT_GROUP]
20:48:28.489 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[qiuguo-iot-box-websocket.yml] & group[DEFAULT_GROUP]
20:48:28.499 [main] INFO o.s.c.b.c.PropertySourceBootstrapConfiguration - [doInitialize,134] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-qiuguo-iot-box-websocket-dev.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-qiuguo-iot-box-websocket.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-qiuguo-iot-box-websocket,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-application-dev.yml,DEFAULT_GROUP'}]

View File

@ -2712,3 +2712,7 @@ java.net.ConnectException: no available server, currentServerAddr : http://192.1
18:57:22.363 [Thread-1] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,108] []- [HttpClientBeanHolder] Start destroying common HttpClient
18:57:22.363 [Thread-13] WARN c.a.n.c.n.NotifyCenter - [shutdown,162] []- [NotifyCenter] Destruction of the end
18:57:22.364 [Thread-1] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,114] []- [HttpClientBeanHolder] Destruction of the end
20:48:26.353 [background-preinit] INFO o.h.v.i.util.Version - [<clinit>,21] - HV000001: Hibernate Validator 6.2.5.Final
20:48:28.485 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[qiuguo-iot-box-websocket] & group[DEFAULT_GROUP]
20:48:28.489 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[qiuguo-iot-box-websocket.yml] & group[DEFAULT_GROUP]
20:48:28.499 [main] INFO o.s.c.b.c.PropertySourceBootstrapConfiguration - [doInitialize,134] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-qiuguo-iot-box-websocket-dev.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-qiuguo-iot-box-websocket.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-qiuguo-iot-box-websocket,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-application-dev.yml,DEFAULT_GROUP'}]

View File

@ -2712,3 +2712,7 @@ java.net.ConnectException: no available server, currentServerAddr : http://192.1
18:57:22.363 [Thread-1] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,108] []- [HttpClientBeanHolder] Start destroying common HttpClient
18:57:22.363 [Thread-13] WARN c.a.n.c.n.NotifyCenter - [shutdown,162] []- [NotifyCenter] Destruction of the end
18:57:22.364 [Thread-1] WARN c.a.n.c.h.HttpClientBeanHolder - [shutdown,114] []- [HttpClientBeanHolder] Destruction of the end
20:48:26.353 [background-preinit] INFO o.h.v.i.util.Version - [<clinit>,21] - HV000001: Hibernate Validator 6.2.5.Final
20:48:28.485 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[qiuguo-iot-box-websocket] & group[DEFAULT_GROUP]
20:48:28.489 [main] WARN c.a.c.n.c.NacosPropertySourceBuilder - [loadNacosData,87] - Ignore the empty nacos configuration and get it based on dataId[qiuguo-iot-box-websocket.yml] & group[DEFAULT_GROUP]
20:48:28.499 [main] INFO o.s.c.b.c.PropertySourceBootstrapConfiguration - [doInitialize,134] - Located property source: [BootstrapPropertySource {name='bootstrapProperties-qiuguo-iot-box-websocket-dev.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-qiuguo-iot-box-websocket.yml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-qiuguo-iot-box-websocket,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-application-dev.yml,DEFAULT_GROUP'}]