From cf16e31632fa5c293c978d27e64dfec7b08e3335 Mon Sep 17 00:00:00 2001 From: dingzhongyuan <dingzhongyuan@kinggrid.com> Date: 星期二, 22 六月 2021 11:31:04 +0800 Subject: [PATCH] 多数据源替换成dynamic-datasource --- ruoyi-admin/src/main/resources/application-dev.yml | 76 ++++++++++++++++++++++++++----------- 1 files changed, 53 insertions(+), 23 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index e16a18d..75093f7 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -1,21 +1,24 @@ # 鏁版嵁婧愰厤缃� spring: + autoconfigure: + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure datasource: type: com.alibaba.druid.pool.DruidDataSource - driverClassName: com.mysql.cj.jdbc.Driver + dynamic: + 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: druid: - # 涓诲簱鏁版嵁婧� - master: - 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: - # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴 - enabled: false - url: - username: - password: # 鍒濆杩炴帴鏁� initialSize: 5 # 鏈�灏忚繛鎺ユ睜鏁伴噺 @@ -35,6 +38,8 @@ testWhileIdle: true testOnBorrow: false testOnReturn: false + # 娉ㄦ剰杩欎釜鍊煎拰druid鍘熺敓涓嶄竴鑷达紝榛樿鍚姩浜唖tat + filters: stat webStatFilter: enabled: true statViewServlet: @@ -67,13 +72,38 @@ password: # 杩炴帴瓒呮椂鏃堕棿 timeout: 10s - lettuce: - pool: - # 杩炴帴姹犱腑鐨勬渶灏忕┖闂茶繛鎺� - min-idle: 0 - # 杩炴帴姹犱腑鐨勬渶澶х┖闂茶繛鎺� - max-idle: 8 - # 杩炴帴姹犵殑鏈�澶ф暟鎹簱杩炴帴鏁� - max-active: 8 - # #杩炴帴姹犳渶澶ч樆濉炵瓑寰呮椂闂达紙浣跨敤璐熷�艰〃绀烘病鏈夐檺鍒讹級 - max-wait: -1ms \ No newline at end of file + # 鏄惁寮�鍚痵sl + ssl: false + +--- # redisson 瀹㈡埛绔厤缃� +redisson: + # 绾跨▼姹犳暟閲� + threads: 16 + # Netty绾跨▼姹犳暟閲� + nettyThreads: 32 + # 浼犺緭妯″紡 + transportMode: "NIO" + # 鍗曡妭鐐归厤缃� + singleServerConfig: + # 瀹㈡埛绔悕绉� + clientName: ${ruoyi.name} + # 鏈�灏忕┖闂茶繛鎺ユ暟 + connectionMinimumIdleSize: 32 + # 杩炴帴姹犲ぇ灏� + connectionPoolSize: 64 + # 杩炴帴绌洪棽瓒呮椂锛屽崟浣嶏細姣 + idleConnectionTimeout: 10000 + # 鍛戒护绛夊緟瓒呮椂锛屽崟浣嶏細姣 + timeout: 3000 + # 濡傛灉灏濊瘯鍦ㄦ闄愬埗涔嬪唴鍙戦�佹垚鍔燂紝鍒欏紑濮嬪惎鐢� timeout 璁℃椂銆� + retryAttempts: 3 + # 鍛戒护閲嶈瘯鍙戦�佹椂闂撮棿闅旓紝鍗曚綅锛氭绉� + retryInterval: 1500 + # 鍙戝竷鍜岃闃呰繛鎺ョ殑鏈�灏忕┖闂茶繛鎺ユ暟 + subscriptionConnectionMinimumIdleSize: 1 + # 鍙戝竷鍜岃闃呰繛鎺ユ睜澶у皬 + subscriptionConnectionPoolSize: 50 + # 鍗曚釜杩炴帴鏈�澶ц闃呮暟閲� + subscriptionsPerConnection: 5 + # DNS鐩戞祴鏃堕棿闂撮殧锛屽崟浣嶏細姣 + dnsMonitoringInterval: 5000 -- Gitblit v1.9.3