设为首页 加入收藏

TOP

MySQL 5.7 MGR单主确定主节点方法(一)
2019-10-09 19:56:19 】 浏览:46
Tags:MySQL 5.7 MGR 单主 确定 节点 方法

MySQL 5.7 MGR单主确定主节点是哪个,我们可以通过成员ID来判断,然后结合read_only参数来确认。


[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)


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:      root@127.0.0.1
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     

首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇MGR单主启动报错处理ERROR 3092 下一篇MySQL 5.7复制延迟之sync_relay_l..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目