创建swarm集群node3节点报错: No address to connect (FATAL)
来源:7-1 课后作业(上)

水手2018
2019-05-14
老师按照作业步骤,创建swarm集群,创建了ip是192.168.140, 141, 142虚机,140虚机上node1节点和node2节点创建没有问题,在141无法创建node3节点,这是什么问题?
2019-05-14T04:24:42.547837Z 0 [Note] WSREP: gcomm thread scheduling priority set to other:0
2019-05-14T04:24:42.547933Z 0 [Warning] WSREP: Fail to access the file (/var/lib/mysql//gvwstate.dat) error (No such file or directory). It is possible if node is booting for first time or re-booting after a graceful shutdown
2019-05-14T04:24:42.547938Z 0 [Note] WSREP: Restoring primary-component from disk failed. Either node is booting for first time or re-booting after a graceful shutdown
2019-05-14T04:24:42.548144Z 0 [Note] WSREP: GMCast version 0
2019-05-14T04:24:42.748204Z 0 [Note] WSREP: (322e3e94, ‘tcp://0.0.0.0:4567’) listening at tcp://0.0.0.0:4567
2019-05-14T04:24:42.748470Z 0 [Note] WSREP: (322e3e94, ‘tcp://0.0.0.0:4567’) multicast: , ttl: 1
2019-05-14T04:24:42.750842Z 0 [Note] WSREP: EVS version 0
2019-05-14T04:24:42.751769Z 0 [Note] WSREP: gcomm: connecting to group ‘PXC’, peer 'node1:'
2019-05-14T04:24:42.752292Z 0 [ERROR] WSREP: failed to open gcomm backend connection: 131: No address to connect (FATAL)
at gcomm/src/gmcast.cpp:connect_precheck():310
2019-05-14T04:24:42.752352Z 0 [ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():209: Failed to open backend connection: -131 (State not recoverable)
2019-05-14T04:24:42.755182Z 0 [ERROR] WSREP: gcs/src/gcs.cpp:gcs_open():1514: Failed to open channel ‘PXC’ at ‘gcomm://node1’: -131 (State not recoverable)
2019-05-14T04:24:42.755375Z 0 [ERROR] WSREP: gcs connect failed: State not recoverable
2019-05-14T04:24:42.755407Z 0 [ERROR] WSREP: Provider/Node (gcomm://node1) failed to establish connection with cluster (reason: 7)
2019-05-14T04:24:42.755421Z 0 [ERROR] Aborting
2019-05-14T04:24:42.755449Z 0 [Note] Giving 0 client threads a chance to die gracefully
2019-05-14T04:24:42.755894Z 0 [Note] WSREP: Waiting for active wsrep applier to exit
3回答
-
水手2018
提问者
2019-05-14
感谢老师,问题已解决。希望对其他小伙伴有帮助,总结如下:
关闭selinux、关掉防火墙 、清空nat表的所有链
1、永久selinux关闭
/usr/sbin/status -v #selinux状态查询
vim /etc/sysconfig/ selinux
SELINUX=enforcing 改为 SELINUX=disabled
重启linux
2、关闭防火墙
systemctl stop firewalld #临时关闭防火墙
firewall-cmd --state #查询防火墙状态
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
3、清空nat表的所有链
iptables -t nat -F #清空nat表的所有链
规则查询
iptables -nvL --line-number
启动docker
docker swarm leave -f #离开swarm集群
docker network rm swarm_test # 删除网路
10 -
水手2018
提问者
2019-05-14
我的两个虚机140,141都在swarm集群中,通过192.168.16.140机器docker容器通过 docker node ls 可以看到,两个虚机都在swarm集群里
192.168.16.141 ip docker容器怎么访问140虚机上的node1节点。不是很明白,是哪里配置错了吗
012019-05-14 -
神思者
2019-05-14
第三个节点连接不到第一个节点,你看一下第三个容器有没有加入到swarm集群
012019-05-14
相似问题