Hi rabbitmq users,
I am trying to run rabbitmq cluster in docker, the docker container scheduling is done through another tool, so the docker container might land in a different slave with docker daemon installed.\
I managed to get rabbitmq nodes cluster work manually, by putting the public ip address plug docker container id in the /etc/hosts file. And now i am trying to automate this process.
The question i am having is: how to change the rabbitmq hostname within docker container? By default, when running rabbitmq in docker, the rabbitmq nodes looks like this: rabbit@[container id]. Considering there will be multiple physical slaves, i cannot know the docker container id if it landed on a different slave.
I tried to update $RABBITMQ_HOSTNAME in the containers, but i am getting errors saying: unable to set short name. If I have $RABBITMQ_LONG_NAME=true set, i am getting errors saying: unable to set long name.
If i try to run the following command:
container1 > rabbitmqctl join_cluster rabbit@[public ip of container 2]
I will get the following error, which looks like the erlang process cannot do distribution because the hostname doesn't match.
* connected to epmd (port 4369) on [public ip of container 2]
* 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?
So what kind of configuration do i need to to in order to be able to make rabbitmq cluster with each other using the public ip.