chengyonghu commented on issue #21558:
URL: 
https://github.com/apache/shardingsphere/issues/21558#issuecomment-1286409360

   `spring:`
     `shardingsphere:`
       `datasource:`
         `ds-0:`
           `driver-class-name: com.mysql.cj.jdbc.Driver`
           `type: com.alibaba.druid.pool.DruidDataSource`
           `driverClassName: com.mysql.jdbc.Driver`
           `url: 
jdbc:mysql://192.168.0.12:3307/xx?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8`
           `username:`
           `password:`
         `names: ds-0`
       `rules:`
         `sharding:`
   
   ​        `binding-tables:`
   
      - `icloud_user_picture,icloud_user_picture_ext,icloud_user_picture_meta`
        `ud_user_folder,icloud_user_folder_ext`
           - 
`icloud_team_picture,icloud_team_picture_ext,icloud_team_picture_meta`
             `ud_team_folder,icloud_team_folder_ext`
                     `tables:`
   
   ​          `icloud_user_picture: # 逻辑表名称`
   ​            `actualDataNodes: ds-0.icloud_user_picture_$->{0..1} # 由数据源名 + 
表名组成(参考 Inline 语法规则)`
   ​            `tableStrategy: # 分表策略,同分库策略`
   ​              `standard:`
   ​                `shardingColumn: user_id #分配键`
   ​                `shardingAlgorithmName: icloud_user_picture_inline #分片规则`
   ​            `keyGenerateStrategy: # 分布式序列策略`
   ​              `column: picture_id # 自增列名称,缺省表示不使用自增主键生成器`
   ​              `keyGeneratorName: leaf # 分布式序列算法名称`
   
   ​        `sharding-algorithms:`
   ​          `icloud_sys_log_inline:`
   ​            `type: CLASS_BASED`
   ​            `props:`
   ​              `strategy: STANDARD`
   ​              `algorithmClassName: 
com.ydtx.camera.icloud.config.CustomPreciseShardingAlgorithm`
   ​          `icloud_user_picture_inline:`
   ​            `type: inline`
   ​            `props:`
   ​              `algorithm-expression: icloud_user_picture_$->{user_id % 2}
   ​          icloud_user_picture_ext_inline:
   ​            type: inline
   ​            props:
   ​              algorithm-expression: icloud_user_picture_ext_$->{user_id % 
2}`
   ​        `keyGenerators:`
   ​          `leaf:`
   ​            `type: "LEAF"`
   
   ## seata 配置
   
   ```
   seata:
     registry:
       type: nacos
     config:
       type: nacos
       nacos:
         server-addr: 127.0.0.1:8848
         group: SEATA_GROUP
         username: nacos
         password: nacos
     #对应nacos配置 service.vgroupMapping.XXXX
     tx-service-group: camera-icloud-tx-group
     application-id: camera-icloud
     use-jdk-proxy: true
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to