rabbitmqrabbitmqctl

Rabbitmq: Unable to join_cluster from a node using FQDN to a node without FQDN


I have a cluster with 2 nodes, neither of them is using FQDN: rabbit@server1, and rabbit@server2. Now i am adding a 3rd rabbitmq node, which uses FQDN: rabbit@server3.mycompany.com. When I run rabbitmqctl join_cluster rabbit@server1

Clustering node 'rabbit@server3.mycompany.com' with rabbit@server1 ...
Error: unable to connect to nodes [rabbit@server1]: nodedown

DIAGNOSTICS
===========

attempted to contact: [rabbit@server1]

rabbit@server1:
  * connected to epmd (port 4369) on server1
  * 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-65@server3.mycompany.com'
- home dir: /home/rabbitmq
- cookie hash: 6P4hzwN1u+rBCLZkYA2zUQ==

I have made use all the cookies are all 3 servers are the same. What else can be wrong?


Solution

  • What you want to do isn't supported by Erlang.

    If you're using at least one FQDN name, they all must be FQDN names and you must use "long names" with RabbitMQ.

    Create the /etc/rabbitmq/rabbitmq-env.conf file with this content on all RabbitMQ nodes:

    USE_LONGNAME=true
    

    After creating the file, ensure that the FQDN for every node name resolves in DNS. Then, restart all RabbitMQ nodes and you should be set.

    Again, you can't mix short and long (FQDN) names.