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

on

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 !

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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

recent

Last Tweets

  • RT : 昨年開催されたOracle MySQL Innovation Day 2018 秋の模様がEnterpriseZineのDB Onlineに掲載されました / MySQL 8.0の新機能から寿司ビール問題まで――Oracle MySQL Innovation Day 2018 秋 via ,
  • If you have a ticket for the pre-FOSDEM Day and you are not able to join, please release your ticket, there are people on the waiting list ! Thank you in advance ! ,
  • When your laptop dies just before 2 weeks of conferences... ,
  • RT : EVENTS:  MySQL Day, Denver, CO Forget Skiing. On Tuesday, January 29, 2019 Denver is all about NoSQL + SQL = MySQL. Join us to learn about NoSQL+SQL, plus how to improve your database performance, secure your data and prevent downtime. Register today! ,
  • RT : MySQL is ubiquitious for cloud usage. In this series I will explore Oracle Cloud's IaaS offerings that support MySQL. In this particular post I will highlight IaaS Enterprise capabilities that help secure our cloud perimiter. ,
Locations of visitors to this page
categories