strongduanmu commented on issue #22355:
URL: 
https://github.com/apache/shardingsphere/issues/22355#issuecomment-1324676875

   server.yaml
   
   ```yaml
   mode:
     type: Cluster
     repository:
       type: ZooKeeper
       props:
         namespace: governance_ds
         server-lists: localhost:2181
         retryIntervalMilliseconds: 500
         timeToLiveSeconds: 60
         maxRetries: 3
         operationTimeoutMilliseconds: 500
   
   rules:
   - !AUTHORITY
     users:
       - root@%:root
       - sharding@:sharding
     provider:
       type: ALL_PERMITTED
   - !TRANSACTION
     defaultType: XA
     providerType: Atomikos
   - !SQL_PARSER
     sqlCommentParseEnabled: true
     sqlStatementCache:
       initialCapacity: 2000
       maximumSize: 65535
     parseTreeCache:
       initialCapacity: 128
       maximumSize: 1024
   
   props:
     max-connections-size-per-query: 1
     kernel-executor-size: 16  # Infinite by default.
     proxy-frontend-flush-threshold: 128  # The default value is 128.
     proxy-hint-enabled: false
     sql-show: true
     check-table-metadata-enabled: false
       # Proxy backend query fetch size. A larger value may increase the memory 
usage of ShardingSphere Proxy.
       # The default value is -1, which means set the minimum value for 
different JDBC drivers.
     proxy-backend-query-fetch-size: -1
     proxy-frontend-executor-size: 0 # Proxy frontend executor size. The 
default value is 0, which means let Netty decide.
       # Available options of proxy backend executor suitable: OLAP(default), 
OLTP. The OLTP option may reduce time cost of writing packets to client, but it 
may increase the latency of SQL execution
       # and block other clients if client connections are more than 
`proxy-frontend-executor-size`, especially executing slow SQL.
     proxy-backend-executor-suitable: OLAP
     proxy-frontend-max-connections: 0 # Less than or equal to 0 means no 
limitation.
       # Available sql federation type: NONE (default), ORIGINAL, ADVANCED
     sql-federation-type: ADVANCED
       # Available proxy backend driver type: JDBC (default), ExperimentalVertx
     proxy-backend-driver-type: JDBC
     proxy-mysql-default-version: 5.7.22 # In the absence of schema name, the 
default version will be used.
     proxy-default-port: 3307 # Proxy default port.
     proxy-netty-backlog: 1024 # Proxy netty backlog.
   ```
   
   config-sharding.yaml
   
   ```yaml
   databaseName: sharding_db
   
   dataSources:
     ds_0:
       url: jdbc:opengauss://localhost:15432/db_0
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_1:
       url: jdbc:opengauss://localhost:15432/db_1
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_2:
       url: jdbc:opengauss://localhost:15432/db_2
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_3:
       url: jdbc:opengauss://localhost:15432/db_3
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_4:
       url: jdbc:opengauss://localhost:15432/db_4
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_5:
       url: jdbc:opengauss://localhost:15432/db_5
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_6:
       url: jdbc:opengauss://localhost:15432/db_6
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_7:
       url: jdbc:opengauss://localhost:15432/db_7
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_8:
       url: jdbc:opengauss://localhost:15432/db_8
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_9:
       url: jdbc:opengauss://localhost:15432/db_9
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
   - !SHARDING
     tables:
       t_order:
         actualDataNodes: ds_${0..9}.t_order
         databaseStrategy:
           standard:
             shardingColumn: user_id
             shardingAlgorithmName: database_inline
       t_order_item:
         actualDataNodes: ds_${0..9}.t_order_item
         databaseStrategy:
           standard:
             shardingColumn: user_id
             shardingAlgorithmName: database_inline
     bindingTables:
       - t_order,t_order_item
     broadcastTables:
       - t_product_category
       - t_country
     shardingAlgorithms:
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${user_id % 10}
   ```


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