wingkingbobo commented on issue #17870:
URL: 
https://github.com/apache/shardingsphere/issues/17870#issuecomment-1134481220

   @strongduanmu 
   * server.yaml
   ```
   mode:
     type: Cluster
     repository:
       type: ZooKeeper
       props:
         namespace: governance_ds
         server-lists: 192.168.0.161:2181
         retryIntervalMilliseconds: 500
         timeToLiveSeconds: 60
         maxRetries: 3
         operationTimeoutMilliseconds: 500
     overwrite: false
   
   rules:
     - !AUTHORITY
       users:
         - root@%:123456
       provider:
         type: ALL_PRIVILEGES_PERMITTED
     - !TRANSACTION
       defaultType: LOCAL
       props:
         recoveryStoreUrl: jdbc:mysql://127.0.0.1:3306/jbossts
         recoveryStoreDataSource: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
         recoveryStoreUser: root
         recoveryStorePassword: 12345678
     - !SQL_PARSER
       sqlCommentParseEnabled: true
       sqlStatementCache:
         initialCapacity: 2000
         maximumSize: 65535
         concurrencyLevel: 4
       parseTreeCache:
         initialCapacity: 128
         maximumSize: 1024
         concurrencyLevel: 4
   
   props:
     max-connections-size-per-query: 1
     kernel-executor-size: 16  
     proxy-frontend-flush-threshold: 128  
     proxy-hint-enabled: false
     sql-show: true
     check-table-metadata-enabled: false
     show-process-list-enabled: false
     proxy-backend-query-fetch-size: -1
     check-duplicate-table-enabled: false
     proxy-frontend-executor-size: 0 
     proxy-backend-executor-suitable: OLAP
     proxy-frontend-max-connections: 0
     sql-federation-enabled: false
     proxy-backend-driver-type: JDBC
   
   ```
   
   * config-sharding.yaml
   ```
   
   schemaName: sharding_db
   
   dataSources:
     mydb1:
       url: 
jdbc:mysql://localhost:3306/mydb1?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowMultiQueries=true
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     mydb_p1:
       url: 
jdbc:mysql://localhost:3306/mydb_p1?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&allowMultiQueries=true
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
     - !SHARDING
       tables:
         layer_major:
           actualDataNodes: mydb1.layer_major,mydb_p$->{1..1}.layer_major
         layer_photo:
           actualDataNodes: mydb1.layer_photo,mydb_p$->{1..1}.layer_photo
         layer_simple:
           actualDataNodes: mydb1.layer_simple,mydb_p$->{1..1}.layer_simple
         layer_simple_group:
           actualDataNodes: 
mydb1.layer_simple_group,mydb_p$->{1..1}.layer_simple_group
         shpae_file_major:
           actualDataNodes: 
mydb1.shpae_file_major,mydb_p$->{1..1}.shpae_file_major
         shpae_file_photo:
           actualDataNodes: 
mydb1.shpae_file_photo,mydb_p$->{1..1}.shpae_file_photo
         shpae_file_simple:
           actualDataNodes: 
mydb1.shpae_file_simple,mydb_p$->{1..1}.shpae_file_simple
         shpae_file_simple_group:
           actualDataNodes: 
mydb1.shpae_file_simple_group,mydb_p$->{1..1}.shpae_file_simple_group
         shape_legend_major:
           actualDataNodes: 
mydb1.shape_legend_major,mydb_p$->{1..1}.shape_legend_major
         shape_legend_photo:
           actualDataNodes: 
mydb1.shape_legend_photo,mydb_p$->{1..1}.shape_legend_photo
         shape_legend_simple:
           actualDataNodes: 
mydb1.shape_legend_simple,mydb_p$->{1..1}.shape_legend_simple
         shape_legend_simple_group:
           actualDataNodes: 
mydb1.shape_legend_simple_group,mydb_p$->{1..1}.shape_legend_simple_group
         shape_major:
           actualDataNodes: mydb1.shape_major,mydb_p$->{1..1}.shape_major
         shape_photo:
           actualDataNodes: mydb1.shape_photo,mydb_p$->{1..1}.shape_photo
         shape_simple:
           actualDataNodes: mydb1.shape_simple,mydb_p$->{1..1}.shape_simple
         shape_simple_group:
           actualDataNodes: 
mydb1.shape_simple_group,mydb_p$->{1..1}.shape_simple_group
         shape_property_major:
           actualDataNodes: 
mydb1.shape_property_major,mydb_p$->{1..1}.shape_property_major
         shape_property_photo:
           actualDataNodes: 
mydb1.shape_property_photo,mydb_p$->{1..1}.shape_property_photo
         shape_property_simple:
           actualDataNodes: 
mydb1.shape_property_simple,mydb_p$->{1..1}.shape_property_simple
         shape_property_simple_group:
           actualDataNodes: 
mydb1.shape_property_simple_group,mydb_p$->{1..1}.shape_property_simple_group
         user_version:
           actualDataNodes: mydb1.user_version,mydb_p$->{1..1}.user_version
           databaseStrategy:
             standard:
               shardingColumn: id
               shardingAlgorithmName: database_id
       defaultDatabaseStrategy:
         standard:
           shardingColumn: userid
           shardingAlgorithmName: database_userid
       shardingAlgorithms:
         database_userid:
           type: INLINE
           props:
             algorithm-expression: $->{if(userid instanceof String) {userid = 
Long.valueOf(userid)};userid<800000?"mydb1":("mydb_p"+((int)((userid-800000)/100000)+1))}
         database_id:
           type: INLINE
           props:
             algorithm-expression: $->{if(id instanceof String) {id = 
Long.valueOf(id)};id<800000?"mydb1":("mydb_p"+((int)((id-800000)/100000)+1))}
   ```


-- 
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