Hi,
After spending one day fighting with setting up a cluster on a single windows machine, I thought I would post this so that people will find it useful.
I followed the guide:
https://www.rabbitmq.com/clustering.htmlbut I couldn't even get one node to start. I was getting different types of errors; every time I would do rabbitmqctrl status, it would show me a different node name running, while nothing was running.
Anyway, what I found is:
Make sure the .erlang.cookie value is the same in %SystemRoot% and %HOMEPATH%. This is documented but easy to overlook and saves sometime in troubleshooting.
1. -detached does not work. It does not report any errors but the server does not start at all. Nothing under task manager either
2. Service did work for me, but I needed a cluster so I did not use the service
3. This link (almost) worked:
https://gist.github.com/Kostassoid/8422347 (Thanks to this guy for getting me 95% there)
4. This is what did work for me:
Node1.batset RABBITMQ_NODE_PORT=6001
set RABBITMQ_NODENAME=rabbit1
set RABBITMQ_SERVICE_NAME=rabbit1
set RABBITMQ_SERVER_START_ARGS=-rabbitmq_management listener [{port,15672}]
call rabbitmq-server
Node2.batset RABBITMQ_NODE_PORT=6002
set RABBITMQ_NODENAME=rabbit2
set RABBITMQ_SERVICE_NAME=rabbit2
set RABBITMQ_SERVER_START_ARGS=-rabbitmq_management listener [{port,15673}]
call rabbitmq-server
cluster.batcall rabbitmqctl -n rabbit2 stop_app
call rabbitmqctl -n rabbit2 join_cluster rabbit1@XXX
call rabbitmqctl -n rabbit2 start_app
The documentation on
rabbitmq.com does not show RABBITMQ_SERVICE_NAME and it has quotes around -rabbitmq_management listener [{port,15673}] which is incorrect.
5. rabbitmqctl does not work without -n name. When name is not specified, this is the output (its setting default to rabbit somehow somewhere):
C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.5.6\sbin>
rabbitmqctl.bat cluster_status
Cluster status of node 'rabbit@XXX' ...
Error: unable to connect to node 'rabbit@XXX': nodedown
DIAGNOSTICS
===========
attempted to contact: ['rabbit@XXX']
rabbit@XXX:
* connected to epmd (port 4369) on XXX
* epmd reports: node 'rabbit' not running at all
other nodes on XXX: [rabbit1,rabbit2,
'rabbitmq-cli-4596']
* suggestion: start the node
current node details:
- node name: 'rabbitmq-cli-4596@XXX'
- home dir: C:\Users\xxx
- cookie hash: QJo32O21uxGHRugYRhMz/Q==
6. I don't know where it gets node name: 'rabbitmq-cli-4596@XXX' but whenever I run rabbitmqct command I see a new one
7. set RABBITMQ_SERVER_START_ARGS=-rabbitmq_management listener [{port,15673}] is not needed if not using the management plugin (but plugin helped me know what was going on)
I hope they update their documentation and other people find this helpful.