mariadb galera启动问题

搭建了mariadb galera集群后,整个集群停掉后如何启动呢,我们要先启动那个节点呢,今天我尝试把集群机器全部停掉,然后任意启动一个节点,发现报如下的错误:

170620 21:32:55 [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 .

意思该节点不是最后一个离开集群的节点(最后停掉的节点),可能没有包含所有更新的数据,强制从该节点启动,需要手工编辑grastate.dat文件,设置safe_to_bootstrap=1,当然了,我们不需需要强制从该节点启动,我们逐一排查每个节点下的grastate.dat文件(该文件在data目录下),找到safe_to_bootstrap=1的节点,然后在该节点上启动即可.

比如我这里找到节点的是节点3
[root@hxl03 data]# more grastate.dat
# GALERA saved state
version: 2.1
uuid: 43caaa91-54bf-11e7-9321-c60bd8969b24
seqno: 2919
safe_to_bootstrap: 1

集群中第一台mariadb启动方法:

/etc/init.d/mysql start --wsrep-new-cluster

集群中其它数据启动方法:

/etc/init.d/mysql start

原文地址:https://www.cnblogs.com/hanxing/p/7719696.html