一主两从,爆红是正常的,不知为啥
spring:
shardingsphere:
datasource:
names: ds_master,ds_s1,ds_s2
ds_master:
type: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://192.168.135.100:3306/gmall_product?serverTimezone=UTC
username: root
password: 123456
ds_s1:
type: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://192.168.135.100:3307/gmall_product?serverTimezone=UTC
username: root
password: 123456
ds_s2:
type: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://192.168.135.100:3308/gmall_product?serverTimezone=UTC
username: root
password: 123456
rules:
readwrite-splitting:
data-sources:
product-rw-ds:
type: Static
props:
write-data-source-name: ds_master
read-data-source-names: ds_s1,ds_s2
load-balancer-name: product_lb_alg #负载均衡算法名称
# static-strategy: #读写分离策略
load-balancers:
product_lb_alg:
type: ROUND_ROBIN
sharding-jdbc读写分离配置
m0_719084112025-08-17 18:16
相关推荐
没有bug.的程序员1 小时前
分布式架构未来趋势:从云原生到智能边缘的演进之路毕业设计制作和分享3 小时前
springboot150基于springboot的贸易行业crm系统小梁努力敲代码8 小时前
java数据结构--List的介绍摸鱼的老谭8 小时前
构建Agent该选Python还是Java ?lang201509289 小时前
Spring Boot 官方文档精解:构建与依赖管理夫唯不争,故无尤也9 小时前
Tomcat 启动后只显示 index.jsp,没有进入你的 Servlet 逻辑zz-zjx9 小时前
Tomcat核心组件全解析Deschen9 小时前
设计模式-外观模式why技术10 小时前
从18w到1600w播放量,我的一点思考。夫唯不争,故无尤也10 小时前
JavaWeb流式传输速查宝典