zl程序教程

您现在的位置是:首页 >  系统

当前栏目

Centos环境部署consul集群,使用join操作报错:Failed to join any nodes.

centosFailed集群部署 报错 环境 操作 to
2023-09-14 09:13:55 时间

(1)问题描述

Centos环境部署consul集群,使用join操作报错:

[zhuyb@centos8 consul]$ ./consul join 192.168.78.101
Error joining address '192.168.78.101': Unexpected response code: 500 (1 error occurred:
	* Failed to join 192.168.78.101: dial tcp 192.168.78.101:8301: connect: no route to host

)
Failed to join any nodes.

报错原因:Centos虚拟机开启了防火墙,导致每个consul节点无法通信。

(2)解决方案

解决方案:关闭Centos虚拟机的防火墙。

# 查看防火墙状态
systemctl status firewalld
# 停止防火墙
systemctl stop firewalld

防火墙关闭后,再次执行consul集群命令(IP地址修改成自己的节点IP即可),如下:

./consul join 192.168.78.101

成功完成关联集群。