Two nodes in the pxc cluster shut down abnormally, and the surviving nodes become non-Primary.
MariaDB [(none)] > show status like 'wsrep_cluster_status'
+-+ +
| | Variable_name | Value |
+-+ +
| | wsrep_cluster_status | non-Primary |
+-+ +
1 row in set (0.001 sec)
MariaDB [(none)] > SET GLOBAL wsrep_provider_options='pc.bootstrap=true'
Query OK, 0 rows affected (0.004 sec)
MariaDB [(none)] > show status like 'wsrep_cluster_status'
+-+ +
| | Variable_name | Value |
+-+ +
| | wsrep_cluster_status | Primary |
+-+ +
1 row in set (0.001 sec)
MariaDB [(none)] > exit
Bye
[oracle@204_maridb mysql] $
Make sure that the nodes are normal when other clusters are shut down
SET GLOBAL wsrep_provider_options='pc.bootstrap=true'
Execution by other nodes
/ usr/bin/mysqld_safe-- wsrep-recover
Get the seqno when you drop the line from the error log
Modify the parameter file grastates.dat
Vi grastates.dat
-- if this seqno is greater than the wsrep_local_cached_ downto value of the surviving node
-- start mysql service directly
Systemctl start mysql
Note:
A node survives. After B node joins, C node needs to specify An as the donor of sst when joining.
Execute show global variables like'% node_name%' on node A
Mysqld_safe-wsrep_sst_donor=nodeA