Gcahce things are not enough, catch up with binlog
The down node is started as a single-machine cluster, that is, it is started as a cluster, but the UUID must be consistent with the old cluster:
The way to repair the grastate.dat file is omitted here, just go directly through wsrep_recovery
After repairing the grastate.dat file, take the seqno in it (assuming 737), and then find the start-position of the binlong of other nodes with the help of seqno:
[root@pxc_node0_172.16.11.127 ~]# mysqlbinlog -vv /data/database/pxc3306/pxc-3306-bin.00000* | grep -A5 "Xid = 737"
# 180420 20:17:16 server id 127 end_log_pos 2221492 Xid = 737 # 就是这个
COMMIT/*!*/;
# at 105205941
# 180424 14:41:01 server id 127 end_log_pos 105206002 GTID last_committed=44702 sequence_number=44710 rbr_only=yes
Export binlog:
[root@pxc_node0_172.16.11.127 ~]# mysqlbinlog -vv /data/database/pxc3306/pxc-3306-bin.00000* --start-datetime="2018-04-24 14:41:01" > binlog.sql
Comment out the configuration file and remove the following configuration:
wsrep_cluster_address=gcomm://30.0.0.227,30.0.0.226,30.0.0.225
The grastate.dat file is modified as follows:
safe_to_bootstrap: 1
start up:
[root@pxc_node2_172.16.11.137 ~]#/usr/bin/mysqld_safe --defaults-file=/etc/pxc3306.cnf --wsrep-cluster-address="gcomm://" &
This is the non-main mode:
ERROR 1047 (08S01): WSREP has not yet prepared node for application use
To solve non-main mode:
(root@localhost) [(none)]> SET GLOBAL wsrep_provider_options='pc.bootstrap=true';
import binlog:
(root@localhost) [(none)]> source /data/backup/sql ;
close the instance
Reconfigure grastate.dat
[root@pxc_node2_172.16.11.137 ~]# vim /data/database/pxc3306/grastate.dat
# GALERA saved state
version: 2.1
uuid: bf26341f-43cb-11e8-a863-62c0eb4d9e79
seqno: 737
safe_to_bootstrap: 0
Reconfigure the configuration file:
wsrep_cluster_address=gcomm://30.0.0.227,30.0.0.226,30.0.0.225
Restart to join the cluster
Or specify a donor
--wsrep_sst_donor=xxx