|
@@ -1,27 +1,21 @@
|
|
|
# 数据源配置
|
|
|
spring:
|
|
|
- autoconfigure:
|
|
|
- exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
|
|
datasource:
|
|
|
type: com.alibaba.druid.pool.DruidDataSource
|
|
|
- # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
|
|
- dynamic:
|
|
|
- #设置默认的数据源或者数据源组,默认值即为 master
|
|
|
- primary: master
|
|
|
- datasource:
|
|
|
- # 主库数据源
|
|
|
- master:
|
|
|
- driverClassName: com.mysql.cj.jdbc.Driver
|
|
|
- url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
|
|
|
- username: root
|
|
|
- password: root
|
|
|
- # 从库数据源
|
|
|
- slave:
|
|
|
- driverClassName: com.mysql.cj.jdbc.Driver
|
|
|
- url:
|
|
|
- username:
|
|
|
- password:
|
|
|
+ driverClassName: com.mysql.cj.jdbc.Driver
|
|
|
druid:
|
|
|
+ # 主库数据源
|
|
|
+ master:
|
|
|
+ url: jdbc:mysql://47.118.76.192:3306/ry_vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
|
|
|
+ username: root
|
|
|
+ password: Shen1992#
|
|
|
+ # 从库数据源
|
|
|
+ slave:
|
|
|
+ # 从数据源开关/默认关闭
|
|
|
+ enabled: false
|
|
|
+ url:
|
|
|
+ username:
|
|
|
+ password:
|
|
|
# 初始连接数
|
|
|
initialSize: 5
|
|
|
# 最小连接池数量
|
|
@@ -41,8 +35,6 @@ spring:
|
|
|
testWhileIdle: true
|
|
|
testOnBorrow: false
|
|
|
testOnReturn: false
|
|
|
- # 注意这个值和druid原生不一致,默认启动了stat
|
|
|
- filters: stat
|
|
|
webStatFilter:
|
|
|
enabled: true
|
|
|
statViewServlet:
|
|
@@ -66,13 +58,13 @@ spring:
|
|
|
# redis 配置
|
|
|
redis:
|
|
|
# 地址
|
|
|
- host: localhost
|
|
|
+ host: 47.118.76.192
|
|
|
# 端口,默认为6379
|
|
|
port: 6379
|
|
|
# 数据库索引
|
|
|
database: 0
|
|
|
# 密码
|
|
|
- password:
|
|
|
+ password: "019920212"
|
|
|
# 连接超时时间
|
|
|
timeout: 10s
|
|
|
# 是否开启ssl
|