RabbitMQ Error: unable to connect to nodes : nodedown

As the error message says, your hostnames do not resolve:

rabbit@ip-10-23-209-142: * unable to connect to epmd (port 4369) on ip-10-23-209-142: nxdomain (non-existing domain)

You need to declare those hostnames in your DNS or in /etc/hosts on both hosts. You can then test the name resolution is working by using eg. ping(1):

ping ip-10-23-209-142 # from ip-10-23-20-36

I got the same error like that today and the suggestion is meaningless.

So, firstly, you should check its log at /var/log/rabbitmq/rabbitmq@[your hostname].log or you waste your time. Then you can see what's happened there.

In my case, it reported an error in file /var/db/rabbitmq/mnesia/rabbit@www/cluster_nodes.config

 Error description:


{error,{cannot_read_file,"/var/db/rabbitmq/mnesia/rabbit@www/cluster_nodes.config",
                        {1,erl_parse,["syntax error before: ","'@'"]}}}

So, I just remove this folder /var/db/rabbitmq/mnesia/rabbit@www and restart the service and it works like a charm


Below command fixed the issue:

sudo service rabbitmq-server start

Reason:

  • Having rabbitmq on both Windows & its Linux subsystem (Ubututu 18, downloaded from Microsoft Store) on same machine.
  • Uninstall rabbitmq on Windows OS
  • Ran the above command

Hope that helps someone.