pxc集羣中2個節點非正常關機,此時存活的節點變成 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]$

確保其它集羣關閉的情況下,使節點正常
SET GLOBAL wsrep_provider_options='pc.bootstrap=true';

其它節點執行
/usr/bin/mysqld_safe --wsrep-recover
根據錯誤日誌獲取掉線時的seqno
修改參數文件 grastates.dat
vi grastates.dat
--如果此seqno 大於存活節點的wsrep_local_cached_downto值,
--直接啓動mysql服務
systemctl start mysql

注意:
A 節點存活,B節點加入後,C節點加入時需要指定A作爲 sst的donor
在A節點執行 show global variables like '%node_name%';
mysqld_safe --wsrep_sst_donor=nodeA

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章