Detailed explanation of MySQL 5.7 MGR single master determination master node method

Detailed explanation of MySQL 5.7 MGR single master determination master node method

Our bank's MGR will be launched at the end of the year. I have to read the official documents and do tests every day. I insist on writing a small knowledge point every day. Is there anyone who wants to learn together?

MySQL 5.7 MGR single master determines which is the primary node. We can judge by the member ID and then confirm it in combination with the read_only parameter.

[root@localhost ~]# mysql -uroot -p -P 3306 -h 127.0.0.1
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 857246
Server version: 5.7.26-29-log Percona Server (GPL)

Copyright (c) 2009-2019 Percona LLC and/or its affiliates
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> status
--------------
mysql Ver 14.14 Distrib 5.7.26-29, for Linux (x86_64) using EditLine wrapper

Connection id: 857246
Current database:  
Current user: [email protected]
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.7.26-29-log Percona Server (GPL)
Protocol version: 10
Connection: 127.0.0.1 via TCP/IP
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 39 days 8 hours 53 min 39 sec

Threads: 4 Questions: 4989552 Slow queries: 731837 Opens: 930 Flush tables: 1 Open tables: 924 Queries per second avg: 1.466
--------------

mysql> SHOW STATUS LIKE 'group_replication_primary_member';
+----------------------------------+--------------------------------------+
| Variable_name | Value |
+----------------------------------+--------------------------------------+
| group_replication_primary_member | 59d7f183-b8f6-11e9-863b-005056875165 |
+----------------------------------+--------------------------------------+
1 row in set (0.00 sec)

mysql> select * from performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
| group_replication_applier | 500dd0aa-b8f6-11e9-85ba-005056875a61 | 196.55.7.37 | 3306 | ONLINE |
| group_replication_applier | 59d7f183-b8f6-11e9-863b-005056875165 | 196.55.7.36 | 3306 | ONLINE |
| group_replication_applier | 69e1c26d-b8f6-11e9-91c1-00505687032a | 196.55.7.38 | 3306 | ONLINE |
+---------------------------+--------------------------------------+-------------+-------------+--------------+
3 rows in set (0.00 sec)

mysql> show variables like '%read_only';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| innodb_read_only | OFF |
| read_only | OFF |
| super_read_only | OFF |
| transaction_read_only | OFF |
| tx_read_only | OFF |
+-----------------------+-------+
5 rows in set (0.01 sec)

mysql> 

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to configure MGR single master and multiple slaves in MySQL 8.0.15
  • What are the advantages of MySQL MGR?
  • Detailed explanation of mysql MGR single-master and multi-master mode switching knowledge points
  • mysql 8.0.18 mgr installation and its switching function
  • MySQL 8.0.18 uses clone plugin to rebuild MGR implementation
  • Common problems and solutions during MySQL MGR construction

<<:  Detailed steps for setting up the network for the virtual machine that comes with win10 (graphic tutorial)

>>:  A simple method to deal with the tabBar at the bottom of WeChat applet blocking content

Recommend

Explanation of MySQL performance inspection through show processlist command

The show processlist command is very useful. Some...

HTML basic structure_Powernode Java Academy

Many times when learning web page development, th...

Implementation of Docker CPU Limit

1. --cpu=<value> 1) Specify how much availa...

A summary of some of the places where I spent time on TypeScript

Record some of the places where you spent time on...

Detailed steps to build the TypeScript environment and deploy it to VSCode

Table of contents TypeScript environment construc...

VUE+Canvas implements the game of God of Wealth receiving ingots

Welcome to the previous canvas game series: 《VUE ...

JavaScript Timer Details

Table of contents 1. Brief Introduction 2. setInt...

Several magical uses of JS ES6 spread operator

Table of contents 1. Add attributes 2. Merge mult...

Implementation of proxy_pass in nginx reverse proxy

The format is simple: proxy_pass URL; The URL inc...

The difference between Display, Visibility, Opacity, rgba and z-index: -1 in CSS

We often need to control the hidden, transparent ...

How Web Designers Create Images for Retina Display Devices

Special statement: This article is translated bas...

Notes on using the blockquote tag

<br />Semanticization cannot be explained in...

Summary of some tips on MySQL index knowledge

Table of contents 1. Basic knowledge of indexing ...

Vue3.0 handwriting magnifying glass effect

The effect to be achieved is: fixed zoom in twice...