Skip to content
Advertisement

rabbitmq cluster mistmatch hostname issue

I have deployed openstack-ansible with 3 node rabbitmq cluster and it use lxc to run rabbitmq on top, I am seeing very strange error here when i did rabbitmqctl status command, if you notice its talking to wrong node ostack-controller-01 is host node and not a actual rabbitmq node..

JavaScript

How do i fix this behavior and tell rabbitmq to talk to correct host which is ostack-controller-01-rabbit-mq-container-1bf6ede2

I have tried forget_cluster_node but no luck, still throwing same error.

JavaScript

UPDATE: 1

JavaScript

UPDATE – 2

This is interesting… why following command working but not rabbitmqctl cluster_status?

JavaScript

Advertisement

Answer

First things first, RabbitMQ 3.6.9 is old and you should be using the latest version.

Having said that, that’s not the issue. The output of echo $HOSTNAME is this:

JavaScript

So, when rabbitmqctl status runs, it uses this code to determine the node name to which to connect to. Since the HOSTNAME variable is set, that is used to determine the node name, and rabbitmqctl tries to use rabbit@ostack-controller-01, which fails.

You can continue to use the -n rabbit@ostack-controller-01-rabbit-mq-container-1bf6ede2 argument to rabbitmqctl to work around this. Or, you can create the /etc/rabbitmq/rabbitmq-env.conf file with this content:

JavaScript

Then, rabbitmqctl status and other rabbitmqctl commands should work. You would then repeat this process on every node, using that node’s correct name in /etc/rabbitmq/rabbitmq-env.conf


NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement