今天在搭建rabbitmq 集群时,将其中一个节点加入集群时,报下面这些错误:
root@host-10-0-0-4 log]# rabbitmqctl join_cluster rabbit@host-10-0-0-5
Clustering node 'rabbit@host-10-0-0-4' with 'rabbit@host-10-0-0-5' ...
Error: unable to connect to nodes ['rabbit@host-10-0-0-5']: nodedown
DIAGNOSTICS
===========
attempted to contact: ['rabbit@host-10-0-0-5']
rabbit@host-10-0-0-5:
* unable to connect to epmd (port 4369) on host-10-0-0-5: nxdomain (non-existing domain)
current node details:
- node name: 'rabbitmq-cli-49@host-10-0-0-4'
- home dir: /var/lib/rabbitmq
- cookie hash: OTrp4p7MdSuR1Su+mlFfQw==
找了好多办法都不行,后来查询说是/etc/hosts文件中配置的主机名必须是实际的主机名才可以,结果试了一下,立马就解决问题了。