Reputation: 1185
I am new to rabbitMQ and Linux. I am following clustering guide at https://www.rabbitmq.com/clustering.html
I have three nodes all running CentOS 7 (On virtual machines with statics IPs).
I have copied the erlang cookie to all machines.
I have set hosts in hosts file as the following This on machine 2
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.198.100 rabbit1
127.0.0.1 rabbit2
192.168.198.102 rabbit3
But hen trying to join rabbit2 to rabbit1 using
rabbitmqctl join_cluster rabbit@rabbit1
I get the following error
Clustering node rabbit@localhost with rabbit@rabbit1 ...
Error: unable to connect to nodes [rabbit@rabbit1]: nodedown
DIAGNOSTICS
===========
attempted to contact: [rabbit@rabbit1]
rabbit@rabbit1:
* connected to epmd (port 4369) on rabbit1
* epmd reports node 'rabbit' running on port 25672
* TCP connection succeeded but Erlang distribution failed
* suggestion: hostname mismatch?
* suggestion: is the cookie set correctly?
* suggestion: is the Erlang distribution using TLS?
current node details:
- node name: 'rabbitmq-cli-72@localhost'
- home dir: /var/lib/rabbitmq
- cookie hash: YlXmRhqgpV9H7lgqXslI1g==
Could anyone help me figure out what's wrong with this?
Upvotes: 1
Views: 3699
Reputation: 10202
I'm assuming you have set 192.168.198.102 to your rabbit2 VM, so you could try and change the line in /etc/hosts from
127.0.0.1 rabbit2
to 192.168.198.102 rabbit2
.
Also a tip, try using docker instead of VMs, it's faster and lighter.
Upvotes: 0
Reputation: 2137
Your nodes are named rabbit@localhost
:
Clustering node rabbit@localhost with rabbit@rabbit1
You need to verify what the hostname
command returns. For clustering to work, it must return eg. rabbit1
. If it returns localhost
, verify the configuration of your hosts. How to do that depends on the distribution.
On the Debian and Fedora VMs I have here, the hostname is configured in /etc/hostname
. So you would need something like:
echo rabbit1 > /etc/hostname
But please refer to your distribution documentation and tools first.
Upvotes: 4