本文转载自:https://blog.csdn.net/bai0324lin/article/details/81271052
怕忘记做个笔记,感谢原文博主
查看错误日志
grep ‘ERROR’ /var/log/mariadb/mariadb.log
ERROR
[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
问题原因:
该节点不是最后一个离开集群的节点(最后停掉的节点),可能没有包含所有更新的数据.
解决办法(建议使用方法2)
方法1:
强制从该节点启动,需要手工编辑grastate.dat(/var/lib/docker/volumes/mariadb/_data/grastate.dat)文件,设置
safe_to_bootstrap=1,可以尝试使用find(find / -name grastate.dat)命令查找该文件;
方法2:
不强制从该节点启动,我们逐一排查每个节点下的grastate.dat文件(该文件在data目录下),找到safe_to_bootstrap=1的节点,然后在该节点上启动即可。