You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Silecne666 (via GitHub)" <gi...@apache.org> on 2023/04/14 04:27:31 UTC

[GitHub] [shardingsphere] Silecne666 opened a new issue, #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

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

   ## Bug Report
   I am using shardingshper proxy+MGR, with one master and two slaves, to simulate that when a slave node goes down, it cannot be found that the slave node is unusable and will still be routed to the down node
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.3.2
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   After a node goes down, it is no longer routed to that node during queries
   ### Actual behavior
   Still routing according to routing strategy
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   server.yaml
   ```authority:
     users:
       - user: root
         password: root
       - user: sharding
         password: sharding
     privilege:
       type: ALL_PERMITTED
   
   props:
     max-connections-size-per-query: 1
     kernel-executor-size: 16  # Infinite by default.
     proxy-frontend-flush-threshold: 128  # The default value is 128.
     sql-show: true
     proxy.transaction.type: LOCAL 	            #默认为LOCAL事务
     proxy.opentracing.enabled: false              #是否开启链路追踪功能,默认为不开启。
     query.with.cipher.column: true
     check.table.metadata.enabled: true			#是否在启动时检查分表元数据一致性,默认值: false
     overwrite: true
     proxy-mysql-default-version: 8.0.26
     allow.range.query.with.inline.sharding: true``
    ```
   config-database-discovery.yaml
     ```
   databaseName: database_discovery_db
   
   dataSources:
     ds_0:
       url: jdbc:mysql://server02:3306/demo_primary_ds?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 3000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_1:
       url: jdbc:mysql://10.254.1.225:3306/demo_primary_ds?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 3000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_2:
       url: jdbc:mysql://server01:3306/demo_primary_ds?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 3000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
    
   rules:
     - !READWRITE_SPLITTING
       dataSources:
         replica_ds:
           dynamicStrategy:
             autoAwareDataSourceName: readwrite_ds
             writeDataSourceQueryEnabled: true
           loadBalancerName: random
       loadBalancers:
         random: 
           type: RANDOM
   
     - !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/5 * * * * ?'
       discoveryTypes:
         mgr:
           type: MySQL.MGR
           props:
             group-name: aadaaaaa-adda-adda-aaaa-aaaaaaddaaaa```
   ```
   Normal situation
   ```
   mysql> select * from performance_schema.replication_group_members;
   +---------------------------+--------------------------------------+--------------+-------------+--------------+-------------+----------------+
   | CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST  | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
   +---------------------------+--------------------------------------+--------------+-------------+--------------+-------------+----------------+
   | group_replication_applier | a79ecc9f-d41f-11ed-b0f9-00163e126f06 | server01     |        3306 | ONLINE       | SECONDARY   | 8.0.26         |
   | group_replication_applier | ba91cbfd-d420-11ed-a466-00163e0abb33 | 10.254.1.225 |        3306 | ONLINE       | SECONDARY   | 8.0.26         |
   | group_replication_applier | efb22439-d41d-11ed-89bd-00163e0a040f | server02     |        3306 | ONLINE       | PRIMARY     | 8.0.26         |
   +---------------------------+--------------------------------------+--------------+-------------+--------------+-------------+----------------+
   3 rows in set (0.00 sec)
   ```
   ![image](https://user-images.githubusercontent.com/58200177/231933428-b6b536e5-e1e1-4c59-9af3-a3fda02d3364.png)
   ```
   Simulate slave node downtime
   mysql>  select * from performance_schema.replication_group_members;
   +---------------------------+--------------------------------------+--------------+-------------+--------------+-------------+----------------+
   | CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST  | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
   +---------------------------+--------------------------------------+--------------+-------------+--------------+-------------+----------------+
   | group_replication_applier | ba91cbfd-d420-11ed-a466-00163e0abb33 | 10.254.1.225 |        3306 | ONLINE       | SECONDARY   | 8.0.26         |
   | group_replication_applier | efb22439-d41d-11ed-89bd-00163e0a040f | server02     |        3306 | ONLINE       | PRIMARY     | 8.0.26         |
   +---------------------------+--------------------------------------+--------------+-------------+--------------+-------------+----------------+
   2 rows in set (0.00 sec)
   ```
   ![image](https://user-images.githubusercontent.com/58200177/231933695-f6048aa0-117b-457a-8412-b08c3b3079d3.png)
   
   Expected
   ![image](https://user-images.githubusercontent.com/58200177/231941435-9de358ef-1542-4ea9-ba1d-e2446a3324b8.png)
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Silecne666 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "Silecne666 (via GitHub)" <gi...@apache.org>.
Silecne666 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1510756585

   Okay, the configuration has been sent to your email
   
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zhaojinchao95 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1510650563

   > hi,At present, I am using zk as the registration center, and the proxy can start normally, but it did not solve my initial requirement: high availability。 In cluster mode, even if a node goes down, it will still be routed to that node; In addition, if the master node goes down, MGR will switch to a new master, but at this time, adding through proxy is not possible
   
   It seems your configuration has some mistakes, can you sent it for there or my [email](760147382@qq.com)


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Silecne666 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "Silecne666 (via GitHub)" <gi...@apache.org>.
Silecne666 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1508147681

   If I want to meet such a requirement, how should I configure it, or what version should I use


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zhaojinchao95 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1508015310

   > MGR? ![image](https://user-images.githubusercontent.com/58200177/231966080-809f1aad-37fd-471e-b9dc-35bd8bdc053f.png)
   
   Your ShardingSphere mode


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zhaojinchao95 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1508151702

   > If I want to meet such a requirement, how should I configure it, or what version should I use
   
   ShardingSphere always not supported db-discovery feature in standalone mode. Can you change to cluster mode.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Silecne666 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "Silecne666 (via GitHub)" <gi...@apache.org>.
Silecne666 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1508019146

   ShardingSphere mode is standalone 


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Silecne666 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "Silecne666 (via GitHub)" <gi...@apache.org>.
Silecne666 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1508012842

   MGR?
   ![image](https://user-images.githubusercontent.com/58200177/231966080-809f1aad-37fd-471e-b9dc-35bd8bdc053f.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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zhaojinchao95 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1508127078

   > ShardingSphere mode is standalone
   
   Standalone mode not support heartbeat job. By the way, the db-discvoery feature are removed in `master` branch.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zhaojinchao95 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1510592345

   > May I ask if there are any issues with the configuration of using nacos as the registration center in cluster mode?There is a little lack of relevant information on the internet
   
   ShardingSphere heartbeat job work on Elastic-Job, Elastic-Job, not support nacos as the registration center.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Silecne666 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "Silecne666 (via GitHub)" <gi...@apache.org>.
Silecne666 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1508156696

   OK,But when I was using cluster mode, I encountered a problem again. I used Nacos as the registration center and reported an error when starting it,
   ```
   mode:
     type: Cluster
     repository:
       type: nacos
       props:
         clusterIp: 10.254.1.228:8848   #nacos ip & port
         retryIntervalMilliseconds: 500
         timeToLiveSeconds: 60
         maxRetries: 3
         timeToLiveSeconds: 30
   ```
   error logs
   ```
   Exception in thread "main" org.apache.shardingsphere.infra.util.spi.exception.ServiceProviderNotFoundServerException: SPI-00001: No implementation class load from SPI `org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository`.
           at org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader.lambda$getService$2(TypedSPILoader.java:126)
           at java.util.Optional.orElseThrow(Optional.java:290)
           at org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader.lambda$getService$3(TypedSPILoader.java:126)
           at java.util.Optional.orElseGet(Optional.java:267)
           at org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPILoader.getService(TypedSPILoader.java:126)
           at org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder.getClusterPersistRepository(ClusterContextManagerBuilder.java:67)
           at org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder.build(ClusterContextManagerBuilder.java:49)
           at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:69)
           at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.init(BootstrapInitializer.java:59)
           at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:54)
   ```


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zhaojinchao95 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1507974973

   @Silecne666 Are you use standalone mode?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Silecne666 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "Silecne666 (via GitHub)" <gi...@apache.org>.
Silecne666 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1508209862

   I need help, how should I do it, seek help


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Silecne666 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "Silecne666 (via GitHub)" <gi...@apache.org>.
Silecne666 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1510636533

   hi,At present, I am using zk as the registration center, and the proxy can start normally, but it did not solve my initial requirement: high availability。
   In cluster mode, even if a node goes down, it will still be routed to that node; In addition, if the master node goes down, MGR will switch to a new master, but at this time, adding through proxy is not possible


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Silecne666 commented on issue #25163: Proxy MGR Unable to discover after node outage,Please help check if there are any errors in the configuration

Posted by "Silecne666 (via GitHub)" <gi...@apache.org>.
Silecne666 commented on issue #25163:
URL: https://github.com/apache/shardingsphere/issues/25163#issuecomment-1510549638

   May I ask if there are any issues with the configuration of using nacos as the registration center in cluster mode?There is a little lack of relevant information on the internet


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org