MySQL Group Replication: who is the primary master – updated!

on
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Some time ago I wrote this article explaining how to find which node was the Primary Master in a MySQL Group Replication cluster running in Single-Primary Mode.

In the latest release of Group Replication, MySQL 8.0.2 dmr, Jaideep improved the visibility of Group Replication extending the performance_schema tables (see his article).

Thanks to these improvements, it’s now very easy to find which host is acting a Primary-Master. This is the query you can use:

mysql-sql> SELECT MEMBER_HOST as `PRIMARY` 
           FROM performance_schema.replication_group_members 
           WHERE MEMBER_ROLE='PRIMARY';
+---------+
| PRIMARY |
+---------+
| mysql3  |
+---------+
1 row in set (0.00 sec)

Much easier isn’t it ?

I let you discover the other improvements and features in MySQL 8.0.2 and don’t forget that your feedback is very important !

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

4 thoughts on “MySQL Group Replication: who is the primary master – updated!

  1. this is a good improvement. but i want to know two questions:
    1、is it will support rejoin when one member is offline after a network issue?
    2、at present,mysql shell can not start the cluster stabilize,now have a bug can not fetch the mgr group_name, is it will have feature after cluster restart with all members,mgr will auto recover cluster like galera cluster?

  2. Hi,

    There is a rejoinInstance() adminAPI command to rejoin a node after it was offline. There is also another command when the full cluster was down: rebootClusterFromCompleteOutage()

    Check: https://dev.mysql.com/doc/dev/mysqlsh-api-javascript/1.0/classmysqlsh_1_1dba_1_1_cluster.html#af56d9116e7d6d0cd111aed0971163248 and https://dev.mysql.com/doc/dev/mysqlsh-api-javascript/1.0/classmysqlsh_1_1dba_1_1_dba.html#a64e1c660242082f000a6e0eb60140769
    Cheers,

Leave a Reply

Your email address will not be published. Required fields are marked *

recent

Last Tweets Last Tweets

    Locations of visitors to this page
    categories