温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

pxc集群中2个节点非正常关机,此时存活的节点变成 non-Primary

发布时间:2020-06-19 12:56:00 来源:网络 阅读:820 作者: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]$

确保其它集群关闭的情况下,使节点正常
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

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI