mysql的mgr集群的网络不可达之后脑裂的问题

news2024/11/25 8:20:07

此时主节点上的dml和ddl操作都会挂死,由于脑裂问题,无法判断谁是主谁是备,所以节点无法写操作。

此时需要手动介入处理:


mysql> show variables like '%group_replication_member_expel_timeout%';
+----------------------------------------+-------+
| Variable_name                          | Value |
+----------------------------------------+-------+
| group_replication_member_expel_timeout | 30    |
+----------------------------------------+-------+
1 row in set (0.01 sec)

mysql> show variables like '%group_replication_unreachable_majority_timeout%';
+------------------------------------------------+-------+
| Variable_name                                  | Value |
+------------------------------------------------+-------+
| group_replication_unreachable_majority_timeout | 0     |
+------------------------------------------------+-------+
1 row in set (0.00 sec)

mysql> set GLOBAL group_replication_unreachable_majority_timeout=35;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like '%group_replication_unreachable_majority_timeout%';
+------------------------------------------------+-------+
| Variable_name                                  | Value |
+------------------------------------------------+-------+
| group_replication_unreachable_majority_timeout | 35    |
+------------------------------------------------+-------+
1 row in set (0.01 sec)


mysql> SELECT @@group_replication_local_address;
+-----------------------------------+
| @@group_replication_local_address |
+-----------------------------------+
| 10.1.1.51:33071                   |
+-----------------------------------+
1 row in set (0.00 sec)

mysql> SET GLOBAL group_replication_force_members="10.1.1.51:33071";


ERROR 4118 (HY000): The 'SET GLOBAL group_replication_force_members=10.1.1.51:33071' command encountered a failure. Timeout on wait for view after setting group_replication_force_members.
mysql> 
mysql> 
mysql> show variables like '%group_replication_force_members%';
+---------------------------------+-------+
| Variable_name                   | Value |
+---------------------------------+-------+
| group_replication_force_members |       |
+---------------------------------+-------+
1 row in set (0.01 sec)

mysql> select * from performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 773123a4-daad-11ee-930b-3009f923fbf1 | 10.1.1.51   |        3307 | ONLINE       | PRIMARY     | 8.0.36         | XCom                       |
| group_replication_applier | b2b77622-daad-11ee-a732-3009f925119f | 10.1.1.52   |        3307 | UNREACHABLE  | SECONDARY   | 8.0.36         | XCom                       |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
2 rows in set (0.00 sec)

mysql> select * from performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 773123a4-daad-11ee-930b-3009f923fbf1 | 10.1.1.51   |        3307 | ONLINE       | PRIMARY     | 8.0.36         | XCom                       |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
1 row in set (0.00 sec)

mysql> show variables like '%group_replication_force_members%';
+---------------------------------+-------+
| Variable_name                   | Value |
+---------------------------------+-------+
| group_replication_force_members |       |
+---------------------------------+-------+
1 row in set (0.01 sec)

mysql> select * from performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 773123a4-daad-11ee-930b-3009f923fbf1 | 10.1.1.51   |        3307 | ONLINE       | PRIMARY     | 8.0.36         | XCom                       |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
1 row in set (0.00 sec)

mysql>  show variables like '%group_replication_force_members%';
+---------------------------------+-------+
| Variable_name                   | Value |
+---------------------------------+-------+
| group_replication_force_members |       |
+---------------------------------+-------+
1 row in set (0.00 sec)

mysql> show processlist;
+--------+-----------------+---------------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
| Id     | User            | Host                | db      | Command | Time    | State                                                    | Info                             |
+--------+-----------------+---------------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
|      7 | event_scheduler | localhost           | NULL    | Daemon  |   44294 | Waiting for next activation                              | NULL                             |
|     15 | system user     |                     | NULL    | Connect | 1452183 | waiting for handler commit                               | Group replication applier module |
|     17 | system user     |                     | NULL    | Query   | 1452178 | Replica has read all relay log; waiting for more updates | NULL                             |
|     18 | system user     |                     | NULL    | Connect | 1452183 | Waiting for an event from Coordinator                    | NULL                             |
|     19 | system user     |                     | NULL    | Connect | 1452183 | Waiting for an event from Coordinator                    | NULL                             |
|     20 | system user     |                     | NULL    | Connect | 1452183 | Waiting for an event from Coordinator                    | NULL                             |
|     21 | system user     |                     | NULL    | Connect | 1452183 | Waiting for an event from Coordinator                    | NULL                             |
| 483710 | root            | 112.74.19.133:33882 | prebill | Sleep   |    1469 |                                                          | NULL                             |
| 483860 | root            | 112.74.19.133:33934 | prebill | Sleep   |    1040 |                                                          | NULL                             |
| 483925 | root            | 10.1.1.51:57846     | prebill | Query   |       0 | init                                                     | show processlist                 |
+--------+-----------------+---------------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
10 rows in set, 1 warning (0.00 sec)

mysql> kill 483710
    -> ;
Query OK, 0 rows affected (0.00 sec)

mysql> show processlist;
+--------+-----------------+---------------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
| Id     | User            | Host                | db      | Command | Time    | State                                                    | Info                             |
+--------+-----------------+---------------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
|      7 | event_scheduler | localhost           | NULL    | Daemon  |   44417 | Waiting for next activation                              | NULL                             |
|     15 | system user     |                     | NULL    | Connect | 1452306 | waiting for handler commit                               | Group replication applier module |
|     17 | system user     |                     | NULL    | Query   | 1452301 | Replica has read all relay log; waiting for more updates | NULL                             |
|     18 | system user     |                     | NULL    | Connect | 1452306 | Waiting for an event from Coordinator                    | NULL                             |
|     19 | system user     |                     | NULL    | Connect | 1452306 | Waiting for an event from Coordinator                    | NULL                             |
|     20 | system user     |                     | NULL    | Connect | 1452306 | Waiting for an event from Coordinator                    | NULL                             |
|     21 | system user     |                     | NULL    | Connect | 1452306 | Waiting for an event from Coordinator                    | NULL                             |
| 483860 | root            | 112.74.19.133:33934 | prebill | Sleep   |    1163 |                                                          | NULL                             |
| 483925 | root            | 10.1.1.51:57846     | prebill | Query   |       0 | init                                                     | show processlist                 |
+--------+-----------------+---------------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
9 rows in set, 1 warning (0.00 sec)

mysql> kill 483860;
Query OK, 0 rows affected (0.00 sec)

mysql> show processlist;
+--------+-----------------+-----------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
| Id     | User            | Host            | db      | Command | Time    | State                                                    | Info                             |
+--------+-----------------+-----------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
|      7 | event_scheduler | localhost       | NULL    | Daemon  |   44426 | Waiting for next activation                              | NULL                             |
|     15 | system user     |                 | NULL    | Connect | 1452315 | waiting for handler commit                               | Group replication applier module |
|     17 | system user     |                 | NULL    | Query   | 1452310 | Replica has read all relay log; waiting for more updates | NULL                             |
|     18 | system user     |                 | NULL    | Connect | 1452315 | Waiting for an event from Coordinator                    | NULL                             |
|     19 | system user     |                 | NULL    | Connect | 1452315 | Waiting for an event from Coordinator                    | NULL                             |
|     20 | system user     |                 | NULL    | Connect | 1452315 | Waiting for an event from Coordinator                    | NULL                             |
|     21 | system user     |                 | NULL    | Connect | 1452315 | Waiting for an event from Coordinator                    | NULL                             |
| 483925 | root            | 10.1.1.51:57846 | prebill | Query   |       0 | init                                                     | show processlist                 |
+--------+-----------------+-----------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
8 rows in set, 1 warning (0.00 sec)

mysql> show processlist;
+--------+-----------------+-----------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
| Id     | User            | Host            | db      | Command | Time    | State                                                    | Info                             |
+--------+-----------------+-----------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
|      7 | event_scheduler | localhost       | NULL    | Daemon  |   44513 | Waiting for next activation                              | NULL                             |
|     15 | system user     |                 | NULL    | Connect | 1452402 | waiting for handler commit                               | Group replication applier module |
|     17 | system user     |                 | NULL    | Query   | 1452397 | Replica has read all relay log; waiting for more updates | NULL                             |
|     18 | system user     |                 | NULL    | Connect | 1452402 | Waiting for an event from Coordinator                    | NULL                             |
|     19 | system user     |                 | NULL    | Connect | 1452402 | Waiting for an event from Coordinator                    | NULL                             |
|     20 | system user     |                 | NULL    | Connect | 1452402 | Waiting for an event from Coordinator                    | NULL                             |
|     21 | system user     |                 | NULL    | Connect | 1452402 | Waiting for an event from Coordinator                    | NULL                             |
| 483925 | root            | 10.1.1.51:57846 | prebill | Query   |       0 | init                                                     | show processlist                 |
+--------+-----------------+-----------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
8 rows in set, 1 warning (0.00 sec)

mysql> show processlist;
+--------+-----------------+-----------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
| Id     | User            | Host            | db      | Command | Time    | State                                                    | Info                             |
+--------+-----------------+-----------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
|      7 | event_scheduler | localhost       | NULL    | Daemon  |   44516 | Waiting for next activation                              | NULL                             |
|     15 | system user     |                 | NULL    | Connect | 1452405 | waiting for handler commit                               | Group replication applier module |
|     17 | system user     |                 | NULL    | Query   | 1452400 | Replica has read all relay log; waiting for more updates | NULL                             |
|     18 | system user     |                 | NULL    | Connect | 1452405 | Waiting for an event from Coordinator                    | NULL                             |
|     19 | system user     |                 | NULL    | Connect | 1452405 | Waiting for an event from Coordinator                    | NULL                             |
|     20 | system user     |                 | NULL    | Connect | 1452405 | Waiting for an event from Coordinator                    | NULL                             |
|     21 | system user     |                 | NULL    | Connect | 1452405 | Waiting for an event from Coordinator                    | NULL                             |
| 483925 | root            | 10.1.1.51:57846 | prebill | Query   |       0 | init                                                     | show processlist                 |
+--------+-----------------+-----------------+---------+---------+---------+----------------------------------------------------------+----------------------------------+
8 rows in set, 1 warning (0.00 sec)

mysql>  show variables like '%group_replication_force_members%';
+---------------------------------+-------+
| Variable_name                   | Value |
+---------------------------------+-------+
| group_replication_force_members |       |
+---------------------------------+-------+
1 row in set (0.01 sec)

mysql> select * from performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 773123a4-daad-11ee-930b-3009f923fbf1 | 10.1.1.51   |        3307 | ONLINE       | PRIMARY     | 8.0.36         | XCom                       |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
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 | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 773123a4-daad-11ee-930b-3009f923fbf1 | 10.1.1.51   |        3307 | ONLINE       | PRIMARY     | 8.0.36         | XCom                       |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
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 | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 773123a4-daad-11ee-930b-3009f923fbf1 | 10.1.1.51   |        3307 | ONLINE       | PRIMARY     | 8.0.36         | XCom                       |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
1 row in set (0.00 sec)

相关参考:

MGR网络抖动问题分析和group_replication_unreachable_majority_timeout等参数分析_group_replication_member_expel_timeout-CSDN博客
 https://www.51cto.com/article/718981.html

MySQL之MGR成员故障导致整个集群不可用的问题排查分析 - 简书

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1607297.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Java上机实验报告(7)

实验 (7) 项目名称:组件及事件处理-注册页面 一、 实验报告内容一般包括以下几个内容: 实验项目名称 实验7 组件及事件处理-注册页面 实验目的和要求 本实验的目的: 本实验的目的是让学生掌握常用的组件类JButton&am…

空气源热泵电控系统部分控制功能的逻辑

空气源热泵的电控系统,是一台空气源热泵设备的大脑,电控系统逻辑的合理性、执行的精准性,直接决定设备运行的稳定、能效高低、运行寿命。 控制功能 (1)压缩机防频繁起停 压缩机再次启动间隔时间为3分钟,即压…

果园系统养殖游戏喂养偷菜种植浇水养成小程序功能介绍

以下是上述功能介绍的重写版本: 装扮 使用丰富的材料,为您的房屋增添独特魅力,展现个性化装饰风格。 土地升级 投入不同数量的材料,提升房屋与土地的品质,打造独一无二的庄园。 日志 通过日志记录,清…

Flask实战

from flask import Flask appFlask(__name__)点击Flask同时点击键盘ctrl即可查看Flask的默认初始化函数 def __init__(self,import_name: str,static_url_path: str | None None,static_folder: str | os.PathLike[str] | None "static",static_host: str | None …

LeetCode-31-下一个排列问题

题目说明 实现获取下一个排列的函数,算法需要将给定数字序列重新排列成字典序中下一个更大的排列。 如果不存在下一个更大的排列,则将数字重新排列成最小的排列(即升序排列)。 必须原地修改,只允许使用额外常数空间。…

考研日常记录

由于实在太无聊了 , 所以记录以下考研备考日常 , 增加一点成就感 , 获得一点前进动力。 2024.4.18 周四 课程情况: 无课 时间规划: 上午:休息 下午: 事项耗时进度备注写作业1h复习英语单词…

SayNav: 利用大语言模型在未知环境中导航

论文标题:SayNav: Grounding Large Language Models for Dynamic Planning to Navigation in New Environments 论文地址:https://arxiv.org/pdf/2309.04077.pdf 项目地址:https://www.sri.com/ics/computer-vision/saynav SayNav介绍 SayNa…

ExpandableListView可扩展列表视图,可折叠列表视图

目录 1. XML代码 2. ExpandableListView的使用 3. ExpandableListAdapter的使用 4. 数据观察者的使用 5. 案例代码一览 ExpandableListView(可扩展/可折叠列表视图)是一种多功能的高级控件,每个子项都可以展开一个孙子列表。点击一个分组…

科研基础与工具(笔记)

​ 免责申明: 本文内容只是学习笔记,不代表个人观点,希望各位看官自行甄别 参考文献 科研基础与工具(YouTube) 专业名词 影响因子(Impact Factor),一般是特指SCI的影响因子&#…

Qt实现Mysql数据库的连接,查询,修改,删除,增加功能

Qt实现Mysql数据库的连接,查询,修改,删除,增加功能 安装Mysql数据库,QtCreator Mysql选择Mysql Server 8.1版本安装。 Mysql Server 8.1安装过程 1.首先添加网络服务权限: WinR键输入compmgmt.msc进入…

论文阅读:BEVBert: Multimodal Map Pre-training for Language-guided Navigation

BEVBert:语言引导导航的多模态地图预训练 摘要 现存的问题:目前大多数现有的预训练方法都采用离散的全景图来学习视觉-文本关联。这要求模型隐式关联全景图中不完整、重复的观察结果,这可能会损害智能体的空间理解。 本文解决方案&#xf…

PCBA镀金工艺介绍

PCBA(印制电路板组装)的镀金工艺是一种常见的表面处理方法,用于提高印制电路板(PCB)的性能和耐用性。本文将详细介绍PCBA的镀金工艺,包括其类型、工艺流程、优点及应用。 1. 镀金工艺的类型 PCBA的镀金主要…

Mac电脑版鼠标连点工具 RapidClick for Mac

RapidClick for Mac是一款方便实用的自动点击工具,可以帮助Mac用户在使用电脑时轻松、快速地进行鼠标操作。它可以模拟人类手指点击的动作,让您的鼠标点击变得更加快捷高效,大大提升了工作和游戏的效率。 RapidClick for Macv1.5.1激活版下载…

【windows-搭建Ubuntu22LTS】

一、环境要求 1. windows版本要求 至少Windows 10 2020年5月(2004) 版, Windows 10 2019年5月(1903) 版,或者 Windows 10 2019年11月(1909) 版 2. 控制面板开启相关的程序(需要重启) 二、Microsoft store安装unbuntu 下载后直接运行(稍微等会&#…

mac: docker安装及其Command not found: docker

已经安装了docker desktop,没安装的 点击安装 傻瓜式安装即可 接着打开终端:好一个 Comand not found:docker 看我不把你整顿,解决如下: 如果你在 macOS 上安装了 Docker Desktop,但是终端无法识别 docker 命令&…

【ARM 裸机】汇编 led 驱动之烧写 bin 文件

1、烧写概念 bin 文件烧写到哪里呢?使用 STM32 的时候烧写到内部 FLASH,6ULL 没有内部 FLASH,是不是就不能烧写呢?不,6ULL 支持 SD卡、EMMC、NAND FLASH、NOR FLASH 等方式启动,在裸机学习的工程中&#x…

C++算法题 - 区间

目录 228. 汇总区间56. 合并区间57. 插入区间452. 用最少数量的箭引爆气球 228. 汇总区间 LeetCode_link 给定一个 无重复元素 的 有序 整数数组 nums 。 返回 恰好覆盖数组中所有数字 的 最小有序 区间范围列表 。也就是说,nums 的每个元素都恰好被某个区间范围所…

IDEA报错然后pycharm闪退

pycharm闪退,在C盘的USER文件夹下有报错文件 打开一看,说内存不足 # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (mmap) failed to map 14596177920 bytes for G1 virtual space # Possib…

Redis入门到通关之分布式锁Rediision

文章目录 ☃️setnx实现的分布式锁存的问题☃️Redisson☃️分布式锁-Redission快速入门☃️实战☃️总结 ☃️setnx实现的分布式锁存的问题 基于setnx实现的分布式锁存在下面的问题: 重入问题:重入问题是指 获得锁的线程可以再次进入到相同的锁的代码…

Win10系统下关闭管理员运行确认弹窗

Windows10及以上系统对于安全的考虑,对于程序运行时的权限做了控制 点击后,会弹出确认的弹窗。 像我做测试,或者使用cmd经常需要administrator 权限,一直弹弹弹就很烦。 要实现右击后无需弹窗就可以使用管理员权限运行改…