unable to connect to node rabbit@localhost: nodedown , despite I copied the cookie all over

2,084 views
Skip to first unread message

it.av...@gmail.com

unread,
Mar 6, 2018, 8:27:07 AM3/6/18
to rabbitmq-users

Hi everyone,
I know there are a lot of stuff about this issue but I was unable to find the correct answer.
I'm following this guide trying to set up a pacemaker cluster for RabbitMQ (I know there is a newer way to set rabbitmq clustering but I've been asked to set this one):
https://www.rabbitmq.com/pacemaker.html

I've set up two ubuntu 16.04 machhines called rabbitmq1 & rabbitmq2 (rabbitmq version 3.6.15 Erlang 20.2).
I was able to set DRBD and Corosync succfully with a reource of floating IP between them.
Both machines in the same VLAN and able to ping eachother by name (firewall is off).

After all was set I added a this reource to pacemaker:
configure primitive bunny ocf:rabbitmq:rabbitmq-server params mnesia_base="/media/drbd1"

However this resource showing in error when I run "crm status":
bunny (ocf::rabbitmq:rabbitmq-server): FAILED (unmanaged)[ rabbitmq2 rabbitmq1 ]

when I try to investigate it by command "pcs resource debug-start bunny" I see this output:

stderr: INFO: Status of node rabbit@localhost Error: unable to connect to node rabbit@localhost: nodedown DIAGNOSTICS =========== attempted to contact: [rabbit@localhost] rabbit@localhost: erlang-solutions_1.0_all.deb connected to epmd (port 4369) on localhost erlang-solutions_1.0_all.deb epmd reports node 'rabbit' running on port 25672 erlang-solutions_1.0_all.deb TCP connection succeeded but Erlang distribution failed erlang-solutions_1.0_all.deb Hostname mismatch: node "rabbit@rabbitmq1" believes its host is different. Please ensure that hostnames resolve the same way locally and on "rabbit@rabbitmq1" current node details: - node name: 'rabbitmq-cli-65@rabbitmq1' - home dir: /var/lib/rabbitmq - cookie hash: O9bMZ3LMnkSPaakjdRYHuw==

stderr: ERROR: Unexpected return from rabbitmqctl -n rabbit@localhost status: 69

Then I run this command "rabbitmqctl -n rabbit@localhost status" and get this output:

Error: unable to connect to node rabbit@localhost: nodedown

DIAGNOSTICS

attempted to contact: [rabbit@localhost]

rabbit@localhost:

  • connected to epmd (port 4369) on localhost

  • epmd reports node 'rabbit' running on port 25672

  • TCP connection succeeded but Erlang distribution failed

  • Hostname mismatch: node "rabbit@rabbitmq1" believes its host is different. Please ensure that hostnames resolve the same way locally and on "rabbit@rabbitmq1"

current node details:

  • node name: 'rabbitmq-cli-30@rabbitmq1'
  • home dir: /var/lib/rabbitmq
  • cookie hash: O9bMZ3LMnkSPaakjdRYHuw==

I tried copying this erlang cookie file to all usere home folder from this location /var/lib/rabbitmq/.erlang.cookie (both to the home folder of root user and to the home folder or rabbitmq user) but its not helping.
what am I doing wrong?

Michael Klishin

unread,
Mar 6, 2018, 12:26:33 PM3/6/18
to rabbitm...@googlegroups.com
Have you checked the suggestion in


> Hostname mismatch: node "rabbit@rabbitmq1" believes its host is different. Please ensure that hostnames resolve the same way locally and on "rabbit@rabbitmq1"

You can see what name the node is using in its log file. The same node must be used with CLI tools.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

it.av...@gmail.com

unread,
Mar 7, 2018, 7:11:37 AM3/7/18
to rabbitmq-users
HiĀ Michael,
Thank you for your reply.
I tried copyingĀ theĀ .erlang.cookie file fromĀ Ā /var/lib/rabbitmq/ to all users home folders.
Also I'veĀ set aĀ /etc/rabbitmq/rabbitmq-env.conf file with this setting in it:
NODENAME=rabbit@rabbitmq1

However, I still get the same error, should I set it in other way?
If so, can you guide me how?

Tnx
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Mar 8, 2018, 2:27:31 PM3/8/18
to rabbitm...@googlegroups.com
Please read the error message I quoted.

The problem is not with the cookie location. If a node believes its name is X and a CLI tool tries to
contact it as node Y, connection will be refused.

To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ

it.av...@gmail.com

unread,
Mar 11, 2018, 4:51:20 AM3/11/18
to rabbitmq-users
Hi Michael,
How can i fix this? I was unable to understand how to do so.
I tried setting it in the fileĀ /etc/rabbitmq/rabbitmq-env.conf:

NODENAME=rabbit@rabbitmq1
NODE_IP_ADDRESS=172.29.87.115
NODE_PORT=5672

HOME=/var/lib/rabbitmq
LOG_BASE=/var/log/rabbitmq

How should I set it in a command for the CLI tool? can you provide me with the command?
thank you for your help on this


To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.

To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Michael Klishin

unread,
Mar 11, 2018, 3:54:23 PM3/11/18
to rabbitm...@googlegroups.com
Pass the same node name the server uses as -n to CLI tools.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages