Clustering on a single windows machine

1,041 views
Skip to first unread message

Fawad Fawad

unread,
Nov 25, 2015, 1:29:22 PM11/25/15
to rabbitmq-users
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.html

but 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.bat
set 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.bat
set 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.bat
call 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.ba
t 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.

Michael Klishin

unread,
Nov 25, 2015, 2:36:29 PM11/25/15
to rabbitm...@googlegroups.com, Fawad Fawad
On 25 November 2015 at 21:29:25, Fawad Fawad (fawad.c...@gmail.com) wrote:
> I hope they update their documentation and other people find
> this helpful.

Thank you. I don't know if we would change our docs to assume you set up a cluster on a single machine
but a section that mentions what ENV variables and ports must be overridden can be useful. 
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Fawad Fawad

unread,
Nov 25, 2015, 3:19:36 PM11/25/15
to rabbitmq-users, fawad.c...@gmail.com
Hi

The way I look at it, on a new machine the section on running a cluster on a single machine should work. There are some windows caveats which are covered, but what I posted before isn't just windows caveats.

Another option would be to point people to these posts that have useful information for windows single cluster scenario. I wanted to make sure I am able to play around with a cluster on a single machine before planning to deploy across machines. Not being able to do so was leaving a sour taste in my mouth, until it finally worked.

The documentation does cover ENV variables and ports, but again it didn't work for me until I stopped doing -detached. That might just be an issue with rabbitmq-server.bat as without -detached it works fine.

The quotation marks around the management server port is definitely incorrect.

Thank you.

Michael Klishin

unread,
Nov 25, 2015, 4:59:43 PM11/25/15
to rabbitm...@googlegroups.com, fawad.c...@gmail.com
Alright, can you point to Windows-specific issues only and not a general transcript?

Again, we value your feedback, just cannot
dump it in the guide as is.

Dan Edwards

unread,
Mar 27, 2017, 7:17:55 AM3/27/17
to rabbitmq-users
Thankyou for this, Fawad
Reply all
Reply to author
Forward
0 new messages