配置多个从库
This commit is contained in:
@@ -40,6 +40,26 @@ spring:
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
slave-1:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://172.18.96.9:3306/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: VideoUser1@
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
slave-2:
|
||||
driver-class-name: ${driver-class-name}
|
||||
jdbc-url: jdbc:mysql://172.18.96.8:3306/duanju?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||
username: root
|
||||
password: VideoUser1@
|
||||
minimum-idle: ${minimum-idle}
|
||||
maximum-pool-size: ${maximum-pool-size}
|
||||
idle-timeout: ${idle-timeout}
|
||||
max-lifetime: ${max-lifetime}
|
||||
connection-timeout: ${connection-timeout}
|
||||
# 数据源配置end
|
||||
|
||||
# 读写分离配置begin
|
||||
@@ -47,9 +67,10 @@ spring:
|
||||
#数据源
|
||||
duanju:
|
||||
master-data-source-name: master-0
|
||||
slave-data-source-names: slave-0
|
||||
# - master-0
|
||||
slave-data-source-names: slave-0,slave-1,slave-2
|
||||
# - slave-0
|
||||
# - slave-1
|
||||
# - slave-2
|
||||
|
||||
swagger:
|
||||
enabled: false
|
||||
|
||||
Reference in New Issue
Block a user