1、调整数据源读取位置

2、调整运维环境数据源连接参数
This commit is contained in:
1378012178@qq.com 2025-08-05 09:07:02 +08:00
parent f6313df57a
commit 695b730384
3 changed files with 17 additions and 19 deletions

View File

@ -29,7 +29,7 @@ public class DataSourceLoader {
public void refreshDataSources() {
DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
DataSource mainDataSource = ds.getDataSource("");
DataSource mainDataSource = ds.getDataSource("devops");
// 从主数据源读取配置
List<DataSourceEntity> configs = new JdbcTemplate(mainDataSource).query(

View File

@ -185,18 +185,17 @@ spring:
username: nu_sys
password: nu_sys
driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置
# multi-datasource1:
# url: jdbc:mysql://1.92.152.160:33061/nursing_unitMediaManageMQListener?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
# username: root
# password: root
# driver-class-name: com.mysql.cj.jdbc.Driver
#运维只读账号
devops:
url: jdbc:mysql://192.168.2.199:3306/nu_devops?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: nudoro
password: nudoro
username: nu_sys
password: nu_sys
driver-class-name: com.mysql.cj.jdbc.Driver
#运维只读账号
# devops:
# url: jdbc:mysql://192.168.2.199:3306/nu_devops?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
# username: nudoro
# password: nudoro
# driver-class-name: com.mysql.cj.jdbc.Driver
#redis 配置
redis:
database: 0

View File

@ -185,18 +185,17 @@ spring:
username: fw8864sshdang
password: uGDBkM25I6nZCNM2
driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置
#multi-datasource1:
#url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
#username: root
#password: root
#driver-class-name: com.mysql.cj.jdbc.Driver
#运维只读账号
devops:
url: jdbc:mysql://mysql8-prod:3306/nu_devops?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: nudoro
password: nudoro
username: fw8864sshdang
password: uGDBkM25I6nZCNM2
driver-class-name: com.mysql.cj.jdbc.Driver
#运维只读账号
# devops:
# url: jdbc:mysql://mysql8-prod:3306/nu_devops?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
# username: nudoro
# password: nudoro
# driver-class-name: com.mysql.cj.jdbc.Driver
#redis 配置
redis:
database: 1