同步操作将从 在我的歌声里/shardingsphere分库分表 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
spring:shardingsphere:props:sql: #sql打印show: true#executor: #工作线程数量,默认值: CPU核数# size: 4orchestration: ###数据库治理功能 配置了zk但是看不到节点name: spring_boot_ds_sharding #治理实例名称overwrite: true #本地配置是否覆盖注册中心配置。如果可覆盖,每次启动都以本地配置为准registry:type: zookeeper #配置中心类型。如:zookeepernamespace: orchestration-spring-boot-sharding-test #注册中心的命名空间server-lists: localhost:2181 #连接注册中心服务器的列表。包括IP地址和端口号。多个地址用逗号分隔。如: host1:2181,host2:2181digest: admin #连接注册中心的权限令牌。缺省为不需要权限验证operation-timeout-milliseconds: 500 #操作超时的毫秒数,默认500毫秒max-retries: 3 #连接失败后的最大重试次数,默认3次retry-interval-milliseconds: 500 #重试间隔毫秒数,默认500毫秒time-to-live-seconds: 60 #临时节点存活秒数,默认60秒props: #配置中心其它属性author: huangjgblog-url: https://www.flyxiaopang.top/datasource: #数据源配置names: db,db0,db1,db2 #数据库别名db: #数据源具体配置,这个可作为默认库type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://localhost:3306/data_source?characterEncoding=utf-8username: rootpassword: rootdb0: #数据源具体配置type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://localhost:3306/data_source0?characterEncoding=utf-8username: rootpassword: rootdb1: #数据源具体配置type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://localhost:3306/data_source1?characterEncoding=utf-8username: rootpassword: rootdb2: #数据源具体配置type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql://localhost:3306/data_source2?characterEncoding=utf-8username: rootpassword: rootsharding: ##分库分表规则default-data-source-name: db #默认数据源,放置不需要分片的表和广播表broadcast-tables: factory,warehouse #广播表,每个库都有独立的表binding-tables: indent,indent_detail,task_upload,code_relate ##绑定表配置default-database-strategy: #默认的分库规则,如果逻辑表没单独配置则使用这个inline:sharding-column: customer_id #默认按照customer_id分库,避免跨库查询algorithm-expression: db$->{customer_id % 3}tables: #逻辑表配置config: ###单库单表,使用UUID作为主键actual-data-nodes: db.configkey-generator:column: codetype: UUIDcustomer:actual-data-nodes: db$->{0..2}.customer$->{0..1} #具体的数据节点table-strategy: ##分表策略inline:sharding-column: customer_name #根据hash值取模确定落在哪张表algorithm-expression: customer$->{Math.abs(customer_name.hashCode() % 2)}key-generator: #配置主键生成策略,默认使用SNOWFLAKEcolumn: customer_idtype: SNOWFLAKEprops:worker:id: 20200422indent:actual-data-nodes: db$->{0..2}.indent$->{0..1}table-strategy:inline:sharding-column: indent_idalgorithm-expression: indent$->{indent_id % 2}key-generator:column: indent_idtype: SNOWFLAKEindent_detail:actual-data-nodes: db$->{0..2}.indent_detail$->{0..1}table-strategy:inline:sharding-column: indent_idalgorithm-expression: indent_detail$->{indent_id % 2}key-generator:column: detail_idtype: SNOWFLAKEtask:actual-data-nodes: db$->{0..2}.task$->{0..1} #具体的数据节点database-strategy: #分库规则inline:sharding-column: task_idalgorithm-expression: db$->{task_id % 3}table-strategy:inline:sharding-column: task_idalgorithm-expression: task$->{task_id % 2}task_upload:actual-data-nodes: db$->{0..2}.task_upload$->{0..1} #具体的数据节点database-strategy: #分库规则inline:sharding-column: task_idalgorithm-expression: db$->{task_id % 3}table-strategy:inline:sharding-column: stack_codealgorithm-expression: task_upload$->{Math.abs(stack_code.hashCode() % 2)}key-generator:column: upload_idtype: SNOWFLAKEcode_relate:actual-data-nodes: db$->{0..2}.code_relate$->{0..1} #具体的数据节点database-strategy: #分库规则inline:sharding-column: task_idalgorithm-expression: db$->{task_id % 3}table-strategy:inline:sharding-column: stack_codealgorithm-expression: code_relate$->{Math.abs(stack_code.hashCode() % 2)}key-generator:column: relate_idtype: SNOWFLAKE
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。