我们行MGR年底要上线了,每天都要看官方文档学习,做测试,坚持每天写一个小知识点,有想一起学习的么~

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

[root@localhost ~]# mysql -uroot -p -P 3306 -h 127.0.0.1mysql: [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 857246Server version: 5.7.26-29-log Percona Server (GPL)Copyright (c) 2009-2019 Percona LLC and/or its affiliatesCopyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.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 wrapperConnection id:   857246Current database:  Current user:    root@127.0.0.1SSL:      Not in useCurrent pager:   stdoutUsing outfile:   ''Using delimiter:  ;Server version:   5.7.26-29-log Percona Server (GPL)Protocol version:  10Connection:   127.0.0.1 via TCP/IPServer characterset:  utf8mb4Db   characterset:  utf8mb4Client characterset:  utf8Conn. characterset:  utf8TCP port:    3306Uptime:     39 days 8 hours 53 min 39 secThreads: 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> 

更多相关文章

  1. MySQL系列多表连接查询92及99语法示例详解教程
  2. Android(安卓)- Manifest 文件 详解
  3. Android的Handler机制详解3_Looper.looper()不会卡死主线程
  4. Selector、shape详解(一)
  5. android2.2资源文件详解4--menu文件夹下的菜单定义
  6. Android(安卓)开机自启动程序
  7. android使用pull解析器来解析和生成xml文件
  8. android与.NET webservice
  9. Android发送短信方法实例详解

随机推荐

  1. Android Service总结01 目录
  2. [Android]滑动刷新ListView——android-p
  3. android - TextView单行显示...或者文字
  4. Android(安卓)RIL学习
  5. Android(安卓)Gradle编译学习日记之一(搭
  6. 【Android學習專題】網絡通信篇:Socket TC
  7. android 控件属性大全
  8. RelativeLayout的各种属性整理
  9. Android菜鸟的成长笔记(11)——Android中的
  10. android之layout布局和ListView中的一些