79 lines
3.9 KiB
YAML
79 lines
3.9 KiB
YAML
mysql:
|
||
db: ${spring.application.name}
|
||
spring:
|
||
shardingsphere:
|
||
druid:
|
||
username: admin
|
||
password: jjb123456
|
||
allows:
|
||
denys:
|
||
props:
|
||
sql:
|
||
show: true
|
||
enabled: true
|
||
masterslave:
|
||
name: ms # 名字,任意,需要保证唯一
|
||
master-data-source-name: master # 主库数据源
|
||
slave-data-source-names: slave-1 # 从库数据源
|
||
datasource:
|
||
names: master,slave-1
|
||
master:
|
||
#url: jdbc:mysql://10.43.123.226:3306/${spring.application.name}?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||
url: jdbc:mysql://${common.mysql.host}:${common.mysql.port}/${mysql.db}?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||
username: ${common.mysql.username}
|
||
password: ${common.mysql.password}
|
||
type: com.alibaba.druid.pool.DruidDataSource
|
||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||
initial-size: 6
|
||
min-idle: 4
|
||
maxActive: 40
|
||
# 配置获取连接等待超时的时间
|
||
maxWait: 60000
|
||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||
timeBetweenEvictionRunsMillis: 60000
|
||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||
minEvictableIdleTimeMillis: 300000
|
||
#Oracle需要打开注释
|
||
#validationQuery: SELECT 1 FROM DUAL
|
||
testWhileIdle: true
|
||
testOnBorrow: false
|
||
testOnReturn: false
|
||
# 打开PSCache,并且指定每个连接上PSCache的大小
|
||
poolPreparedStatements: true
|
||
maxPoolPreparedStatementPerConnectionSize: 20
|
||
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||
filters: slf4j
|
||
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
|
||
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
|
||
wall:
|
||
multi-statement-allow: true
|
||
slave-1:
|
||
# url: jdbc:mysql://10.43.123.226:3306/${spring.application.name}?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||
url: jdbc:mysql://${common.mysql.host}:${common.mysql.port}/${mysql.db}?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||
username: ${common.mysql.username}
|
||
password: ${common.mysql.password}
|
||
type: com.alibaba.druid.pool.DruidDataSource
|
||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||
initial-size: 6
|
||
min-idle: 4
|
||
maxActive: 20
|
||
# 配置获取连接等待超时的时间
|
||
maxWait: 60000
|
||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||
timeBetweenEvictionRunsMillis: 60000
|
||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||
minEvictableIdleTimeMillis: 300000
|
||
#Oracle需要打开注释
|
||
#validationQuery: SELECT 1 FROM DUAL
|
||
testWhileIdle: true
|
||
testOnBorrow: false
|
||
testOnReturn: false
|
||
# 打开PSCache,并且指定每个连接上PSCache的大小
|
||
poolPreparedStatements: true
|
||
maxPoolPreparedStatementPerConnectionSize: 20
|
||
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙,stat已去掉
|
||
filters: slf4j
|
||
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
|
||
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
|
||
wall:
|
||
multi-statement-allow: true |