show status like wsrep_cluster_status ;+----------------------+-------------+| Variable_name | Value |+..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

pxc集群中2個節(jié)點非正常關機,此時存活的節(jié)點變成 non-Primary

發(fā)布時間:2020-06-19 12:56:00 來源:網絡 閱讀:837 作者:xingzhehxiang 欄目:MySQL數據庫

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]$

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

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

注意:
A 節(jié)點存活,B節(jié)點加入后,C節(jié)點加入時需要指定A作為 sst的donor
在A節(jié)點執(zhí)行 show global variables like '%node_name%';
mysqld_safe --wsrep_sst_donor=nodeA

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI