详解MySQL 5.7 MGR单主确定主节点方法
更新时间:2019年09月18日 15:15:31 作者:roidba
这篇文章主要介绍了详解MySQL 5.7 MGR单主确定主节点方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
我们行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) 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: 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 | 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>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
相关文章
mysql 8.0.11 安装配置方法图文教程(win10)
这篇文章主要为大家详细介绍了mysql 8.0.11 安装配置方法图文教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2019-03-03解决MySQL数据库意外崩溃导致表数据文件损坏无法启动的问题
这篇文章主要介绍了MySQL数据库意外崩溃导致表数据文件损坏无法启动的问题及解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2020-07-07MySQL同步ES(Elasticsearch)的四种常见方案分享
MySQL和Elasticsearch(ES)是两个非常重要的数据存储和搜索技术,MySQL是一种关系型数据库,而ES则是一种文档型数据库,在许多情况下,我们需要将MySQL中的数据同步到ES中,本文将介绍四种常见的MySQL同步ES方案,需要的朋友可以参考下2023-07-07MySQL安装出现The configuration for MySQL Server 8.0.28 has
这篇文章主要给大家介绍了MySQL安装出现The configuration for MySQL Server 8.0.28 has failed. You can...错误的解决办法,文中通过图文介绍的非常详细,需要的朋友可以参考下2023-09-09
最新评论