You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/06/19 02:01:37 UTC

[GitHub] [shardingsphere] java-programmer opened a new issue #6122: shardingsphere How do I do master-slave failover of read-write separation?help help help me!!!

java-programmer opened a new issue #6122:
URL: https://github.com/apache/shardingsphere/issues/6122


   **english desc:**
      I set up MySQL Group Replication,one leader with multi-followers,The main library writes data,Only data can be read from the library。
    I see shardingsphere can do read/write separation,Master slave data sources need to be configured,What if my primary node fails?Is there a failover scheme for the master node?
   
   **ch desc:**
    我安装了MySQL Group Replication高可用集群,一主多从模式,主节点写入,从节点只读,我看到shardingsphere可以实现读写分离,需要配置主从数据源,如果我的主节点出现故障怎么办?有可以实现主节点故障转移的方案吗
   
   
   
   


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

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



[GitHub] [shardingsphere] java-programmer commented on issue #6122: shardingsphere How do I do master-slave failover of read-write separation?help help help me!!!

Posted by GitBox <gi...@apache.org>.
java-programmer commented on issue #6122:
URL: https://github.com/apache/shardingsphere/issues/6122#issuecomment-646449922


   Hi @tristaZero 
   This is a good idea, but there are some problems:
   After my master library failed,MySQL Group Replication will automatically switch a slave master library, which can read and write, but the slave library configured in shardingsphere-JDBC can only read, how can I automatically change the state of this slave library accordingly, changing the read-only state to read and write state?
   
   这是一个好的想法,但是还存在以下问题:
   我的主库故障后,MySQL Group Replication会自动切换一个从库为主库,此时这个从库可以读写,但是我在shardingsphere-jdbc里面当时配置的这个从库只能读,怎么才能相应的对这个从库自动变更状态,将只读状态变更为读写状态?
   
    


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

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



[GitHub] [shardingsphere] java-programmer commented on issue #6122: shardingsphere How do I do master-slave failover of read-write separation?help help help me!!!

Posted by GitBox <gi...@apache.org>.
java-programmer commented on issue #6122:
URL: https://github.com/apache/shardingsphere/issues/6122#issuecomment-646760216


   @tristaZero 
   I know that the readonly attribute in the database can be determined, but I don't know how to notify ShardingSphere. Do you have any good solutions?
   我知道数据库中read-only属性可以判断,但是我不知道怎么通知ShardingSphere,请问你有什么好的解决方法吗?


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

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



[GitHub] [shardingsphere] tristaZero commented on issue #6122: shardingsphere How do I do master-slave failover of read-write separation?help help help me!!!

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6122:
URL: https://github.com/apache/shardingsphere/issues/6122#issuecomment-646524849


   @java-programmer 
   Since ShardingSphere can not notice the changes from MySQL Group Replication, users or MySQL is expected to tell ShardingSphere.


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

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



[GitHub] [shardingsphere] tristaZero commented on issue #6122: shardingsphere How do I do master-slave failover of read-write separation?help help help me!!!

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6122:
URL: https://github.com/apache/shardingsphere/issues/6122#issuecomment-647231766


   You just need to update the configuration on the registry center, like the zookeeper.
   @java-programmer 


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

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



[GitHub] [shardingsphere] tristaZero closed issue #6122: shardingsphere How do I do master-slave failover of read-write separation?help help help me!!!

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #6122:
URL: https://github.com/apache/shardingsphere/issues/6122


   


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

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



[GitHub] [shardingsphere] tristaZero commented on issue #6122: shardingsphere How do I do master-slave failover of read-write separation?help help help me!!!

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6122:
URL: https://github.com/apache/shardingsphere/issues/6122#issuecomment-646413130


   Hi @java-programmer 
   The relation information of master and slaves is stored in the registry center, like a zookeeper. 
   
   So, if the master crashed, you needed to tell the registry center the lastest relationship between the new master and its slaves. After that, the registry center would push this event online. 
   
   You can learn more [here](https://shardingsphere.apache.org/document/current/en/features/governance/)


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

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