当前位置: 首页 > backend >正文

sharding-jdbc读写分离配置

一主两从,爆红是正常的,不知为啥
spring:shardingsphere:datasource:names: ds_master,ds_s1,ds_s2ds_master:type: com.zaxxer.hikari.HikariDataSourcedriverClassName: com.mysql.jdbc.DriverjdbcUrl: jdbc:mysql://192.168.135.100:3306/gmall_product?serverTimezone=UTCusername: rootpassword: 123456ds_s1:type: com.zaxxer.hikari.HikariDataSourcedriverClassName: com.mysql.jdbc.DriverjdbcUrl: jdbc:mysql://192.168.135.100:3307/gmall_product?serverTimezone=UTCusername: rootpassword: 123456ds_s2:type: com.zaxxer.hikari.HikariDataSourcedriverClassName: com.mysql.jdbc.DriverjdbcUrl: jdbc:mysql://192.168.135.100:3308/gmall_product?serverTimezone=UTCusername: rootpassword: 123456rules:readwrite-splitting:data-sources:product-rw-ds:type: Staticprops:write-data-source-name: ds_masterread-data-source-names: ds_s1,ds_s2load-balancer-name: product_lb_alg #负载均衡算法名称
#              static-strategy: #读写分离策略load-balancers:product_lb_alg:type: ROUND_ROBIN
http://www.xdnf.cn/news/17976.html

相关文章:

  • Spring——关于Bean以及自动配置
  • FTP上传文件错误
  • BM25算法和传统的TF-IDF算法的区别
  • IEEEtaes.cls解析
  • Trae中`settings.json`文件的Java配置项功能详解(二)
  • 343整数拆分
  • 双椒派E2000D开发板LED驱动开发实战指南
  • 随机整数列表处理:偶数索引降序排序
  • 杂记 03
  • 软件需求工程详解
  • 【自用】JavaSE--特殊文件Properties与XML、日志技术
  • 项目管理进阶——解读大型IT系统集成项目实施要点培训【附全文阅读】
  • 主从复制+哨兵
  • GPFS集群性能压测
  • MySQL的下载安装(MSI和ZIP版本都有)
  • Linux上配置环境变量
  • UDP/TCP套接字编程简单实战指南
  • 【总结型】c语言中的位运算
  • Hugging Face 与 NLP
  • Express开发快速学习
  • Spring Cloud系列—Alibaba Seata分布式事务
  • B站 韩顺平 笔记 (Day 20)
  • 创建maven module中的override
  • MySQL的《Buffer-pool》和《连接池》介绍
  • windows扩展(外接)显示器位置调节
  • CVE-2021-4300漏洞复现
  • 树的直径(树形DP)
  • 云计算-Kubernetes+Istio 实现金丝雀发布:流量管理、熔断、流量镜像、ingreess、污点及pv案例实战
  • 新手向:Python异常处理(try-except-finally)详解
  • LangChain4j:基于 SSE 与 Flux 的 AI 流式对话实现方案