基于Docker的Percona XtraDB Cluster(PXC)掉电无法正常启动的解决方法

1.使用Docker重新start容器ID后,可能会出现下面的错误

Error response from daemon: container fd7f8a24df60aa60e5fcacfdd6c4f36456cff62d062fc26c8d5b427d76a200fe: endpoint join on GW Network failed: driver failed programming external connectivity on endpoint gateway_7227e3f50f1e (9c121a8ada028bda61adad4119b6992b709129fb1e23fd7b685b354375f357ed): Error starting userland proxy: listen tcp 0.0.0.0:3310: bind: address already in use

解决方法:

先试用netstat -lntp|grep 3310(端口号)找到具体进程,然后kill -9 杀掉进程

如果没有发现这个端口号被占用,则使用#>docker service restart,重启Docker

2.重启Docker后,我们需要找到原来设置主的节点,比如node1(参考我之前写的搭建percona xtradb 集群文章

如果报下面这个错误:

通过#>docker logs -f 镜像ID,(或者到主机容器目录看容器日志)

有如下报错:

It may not be safe to bootstrap the cluster from this node. It was not the last one to leave the cluster and may not contain all the updates.
To force cluster bootstrap with this node, edit the grastate.dat file manually and set safe_to_bootstrap to 1

到var/lib/docker/volumes/v1目录(v2,v3目录)将grastate.dat 文件 或者修改 文件 设置 safe_to_bootstrap 为 1

3.最后使用顺序的docker启动命令,即可正常启动pxc和haproxy

#>docker start pxc1镜像ID

#>docker start haproxy1镜像ID

#>docker start pxc2镜像ID

#>docker start haproxy3镜像ID

最后启动keepalived 即可解决问题

参考文章

按照视频中docker stop node1作为挂起第一个节点,当再次start node1遇到问题
https://coding.imooc.com/learn/questiondetail/93379.html
记一次测试环境下PXC集群问题《经验总结》
https://www.cnblogs.com/liangshaoye/p/10438531.html
Percona XtraDB Cluster(PXC)掉电无法正常启动
https://blog.csdn.net/hxpjava1/article/details/80047288
CentOS 下 netstat 命令显示不完整程序名的原因
http://jaminzhang.github.io/linux/the-reason-of-centos-netstat-command-does-not-display-full-program-name/

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我还要去追逐我的梦

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值