I have installed RabbitMQ on my laptop. I start the server (rabbitmq-server -detached
) and then rabbitmqctl start_app
, and things work fine (my Java application can connect and send/receive messages).
$ rabbitmqctl start_app
Starting node 'rabbit@11-020-7206' ...
But when I go to another place, where the network is different, the laptop gets another hostname and I cannot do anything with it anymore. If I try to stop or start it, I get an error that node is down.
$ rabbitmqctl stop
Stopping and halting node 'rabbit@Mahdis-MacBook-Pro' ...
Error: unable to connect to node 'rabbit@Mahdis-MacBook-Pro': nodedown
DIAGNOSTICS
===========
attempted to contact: ['rabbit@Mahdis-MacBook-Pro']
rabbit@Mahdis-MacBook-Pro:
* connected to epmd (port 4369) on Mahdis-MacBook-Pro
* 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-14528@Mahdis-MacBook-Pro'
- home dir: /Users/mahdi
- cookie hash: HBqyY/jYPLAyrH1wt3dTWQ==
If I try to start the server altogether, it says node is running:
$ rabbitmq-server -detached
Warning: PID file not written; -detached was passed.
ERROR: node with name "rabbit" already running on "Mahdis-MacBook-Pro"
How can I fix the hostname to avoid this confusion?