68 lines
2.0 KiB
YAML
68 lines
2.0 KiB
YAML
|
|
spring:
|
|||
|
|
datasource:
|
|||
|
|
type: com.alibaba.druid.pool.DruidDataSource
|
|||
|
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
|||
|
|
druid:
|
|||
|
|
# 主库数据源(生产环境)
|
|||
|
|
master:
|
|||
|
|
url: ${prod.db.url}
|
|||
|
|
username: ${prod.db.username}
|
|||
|
|
password: ${prod.db.password}
|
|||
|
|
# 初始连接数
|
|||
|
|
initial-size: 5
|
|||
|
|
# 最小连接池数量
|
|||
|
|
min-idle: 10
|
|||
|
|
# 最大连接池数量
|
|||
|
|
max-active: 200
|
|||
|
|
# 配置获取连接等待超时的时间
|
|||
|
|
max-wait: 60000
|
|||
|
|
# 配置连接超时时间
|
|||
|
|
connect-timeout: 30000
|
|||
|
|
# 配置网络超时时间
|
|||
|
|
socket-timeout: 60000
|
|||
|
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
|||
|
|
time-between-eviction-runs-millis: 60000
|
|||
|
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
|||
|
|
min-evictable-idle-time-millis: 300000
|
|||
|
|
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
|||
|
|
max-evictable-idle-time-millis: 900000
|
|||
|
|
# 配置检测连接是否有效
|
|||
|
|
validation-query: SELECT 1 FROM DUAL
|
|||
|
|
test-while-idle: true
|
|||
|
|
test-on-borrow: false
|
|||
|
|
test-on-return: false
|
|||
|
|
# 从库数据源
|
|||
|
|
slave:
|
|||
|
|
# 从数据源开关/默认关闭
|
|||
|
|
enabled: false
|
|||
|
|
url:
|
|||
|
|
username:
|
|||
|
|
password:
|
|||
|
|
# Druid监控配置
|
|||
|
|
web-stat-filter:
|
|||
|
|
enabled: true
|
|||
|
|
stat-view-servlet:
|
|||
|
|
enabled: true
|
|||
|
|
# 设置白名单,不填则允许所有访问
|
|||
|
|
allow:
|
|||
|
|
url-pattern: /druid/*
|
|||
|
|
# 控制台管理用户名和密码
|
|||
|
|
login-username: ruoyi
|
|||
|
|
login-password: 123456
|
|||
|
|
filter:
|
|||
|
|
stat:
|
|||
|
|
enabled: true
|
|||
|
|
# 慢SQL记录
|
|||
|
|
log-slow-sql: false
|
|||
|
|
slow-sql-millis: 1000
|
|||
|
|
merge-sql: true
|
|||
|
|
wall:
|
|||
|
|
config:
|
|||
|
|
multi-statement-allow: true
|
|||
|
|
|
|||
|
|
# PingPong支付配置(生产环境)
|
|||
|
|
pingpong:
|
|||
|
|
gateway: https://acquirer-payment.pingpongx.com
|
|||
|
|
mode: build
|
|||
|
|
|