zjcnb opened a new issue, #18764:
URL: https://github.com/apache/shardingsphere/issues/18764

   ### Which version of ShardingSphere did you use?
   
   master
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   Route primary data source
   
   ### Actual behavior
   
   Not route primary data source
   
   `server.yaml`
   
   ```
   mode:
     type: Cluster
     repository:
       type: ZooKeeper
       props:
         namespace: governance_ds
         server-lists: localhost:2181
         retryIntervalMilliseconds: 500
         timeToLiveSeconds: 60
         maxRetries: 3
         operationTimeoutMilliseconds: 500
     overwrite: false
   
   rules:
     - !AUTHORITY
       users:
         - root@%:root
         - sharding@:sharding
       provider:
         type: ALL_PERMITTED
   ```
   
   `config-database-discovery.yaml`
   
   ```
   databaseName: database_discovery_db
   
   dataSources:
     ds_0:
       url: 
jdbc:mysql://127.0.0.1:33306/primary_demo_ds?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 3000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_1:
       url: 
jdbc:mysql://127.0.0.1:33307/primary_demo_ds?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 3000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_2:
       url: 
jdbc:mysql://127.0.0.1:33308/primary_demo_ds?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 3000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
   - !DB_DISCOVERY
     dataSources:
       readwrite_ds:
         dataSourceNames:
           - ds_0
           - ds_1
           - ds_2
         discoveryHeartbeatName: mgr-heartbeat
         discoveryTypeName: mgr
     discoveryHeartbeats:
       mgr-heartbeat:
         props:
           keep-alive-cron: '0/1 * * * * ?'
     discoveryTypes:
       mgr:
         type: MySQL.MGR
         props:
           group-name: 558edd3c-02ec-11ea-9bb3-080027e39bd2
   ```
   
   <img width="1881" alt="image" 
src="https://user-images.githubusercontent.com/33742097/176844328-799a2be8-e11d-4cfe-a99a-10484e60535b.png";>
   
   <img width="1496" alt="image" 
src="https://user-images.githubusercontent.com/33742097/176844568-85377208-58bd-4456-9325-8ef4881c8f95.png";>
   
   


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