1.正式环境下基本上不会出现此类情况
2.测试环境的时候可能会出现,如自己电脑上搞的几个虚拟机上测试,后来全部关机了,再想启动集群,报错了
【系统环境】
CentOS7 + MariaDB10.1.22+galera cluster
【解决方式】
1.正常第一次启动集群,使用命令:galera_new_cluster ,其他版本请另行参考
2.整个集群关闭后,再重新启动,则打开任一主机,输入命令:
vim /var/lib/mysql/grastate.dat
#GALERA savedd state
version:2.1
uuid: 自己的cluster id
seqno: -1
safe_to_bootstrap:0
#GALERA savedd state
version:2.1
uuid: 自己的cluster id
seqno: -1
safe_to_bootstrap:0
修改seqno:1
3.重新启动集群命令:galera_new_cluster
4.其他节点:systemctl start mariadb
问题二:
[root@controller1 haproxy]# galera_new_cluster
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
[root@controller1 haproxy]# tail /var/log/mariadb/mariadb.log
2018-03-21 12:16:18 140168333977920 [Note] WSREP: GCache history reset: f84f94a1-2c38-11e8-8ede-96f87262fb85:0 -> f84f94a1-2c38-11e8-8ede-96f87262fb85:-1
2018-03-21 12:16:18 140168333977920 [Note] WSREP: Assign initial position for certification: -1, protocol version: -1
2018-03-21 12:16:18 140168333977920 [Note] WSREP: wsrep_sst_grab()
2018-03-21 12:16:18 140168333977920 [Note] WSREP: Start replication
2018-03-21 12:16:18 140168333977920 [Note] WSREP: 'wsrep-new-cluster' option used, bootstrapping the cluster
2018-03-21 12:16:18 140168333977920 [Note] WSREP: Setting initial position to 00000000-0000-0000-0000-000000000000:-1
2018-03-21 12:16:18 140168333977920 [ERROR] WSREP: It may not be safe to bootstrap the cluster from this node. It was not