Percona XtraDB Cluster(PXC) 无法正常启动

今天重启pxc全部服务器的时候无法启动查看日志的报错如下:

2018-02-03 09:05:50 3913 [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文件,第一次的修改不知道在哪只能运行find命令去找,从根目录找:

cd /
find .  -name 'grastate.dat'

结果文件在/var/lib/mysql/grastate.dat目录下你拷贝这个即可

然后执行vi 命令:

vi  /var/lib/mysql/grastate.dat 

修改safe_to_bootstrap 值 当前文件为0 改为1 结构如下:

# GALERA saved state
version: 2.1
uuid:    002bd039-c2c8-11e7-82c7-36d79987c3c9
seqno:   -1
safe_to_bootstrap: 1

然后执行命令/etc/init.d/mysql bootstrap-pxc 就可以启动 但是当启动完成后 safe_to_bootstrap 会改为0 我猜测可能是某些不正常情况下重启的时候safe_to_bootstrap没有从0改为1导致无法启动的,下次大家遇到同样的问题修改即可。

猜你喜欢

转载自my.oschina.net/majiajue/blog/1617966