问题背景
操作系统:CentOS 7.6
DB版本:MariaDB 10.3.20
DB架构:MariaDB Galera Cluster(3个节点)
MariaDB Galera Cluster三个节点所在操作系统全部reboot。
启动mariadb.service服务报错如下:
2022-05-12 17:12:55 0 [ERROR] WSREP: It may not be safe to bootstrap the cluster from this node. It was not the last one to leave the cluster and may not contain all the updates. To force cluster bootstrap with this node, edit the grastate.dat file manually and set safe_to_bootstrap to 1 .
2022-05-12 17:12:55 0 [ERROR] WSREP: wsrep::connect(gcomm://172.18.143.110,172.18.143.111,172.18.143.112) failed: 7
2022-05-12 17:12:55 0 [ERROR] Aborting
解决办法
通过last -x reboot命令查看三个节点操作系统重启的时间,可以确认节点3是最后一个关闭数据库服务:
- 节点1: 2022年4月23日 18:21
- 节点2: 2022年4月23日 18:19
- 节点3: 2022年4月23日 18:30
三个节点的grastate.dat文件内容一致:
cat /var/lib/mysql/grastate.dat
# GALERA saved state
version: 2.1
uuid: 00000000-0000-0000-0000-000000000000 #不包括此行
seqno: -1
safe_to_bootstrap: 0
三个节点的mariadb.service服务为非正常关闭:
seqno: -1
safe_to_bootstrap: 0
修改MariaDB安全引导参数:
[root]# vi /var/lib/mysql/grastate.dat
safe_to_bootstrap: 1
依次启动mariadb.service集群恢复正常。
参考:https://galeracluster.com/library/training/tutorials/restarting-cluster.html
分类:
MariaDB
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 记一次.NET内存居高不下排查解决与启示