second or third instance of rabbitmq on windows box with different ports (15673,15674,etc)

96 views
Skip to first unread message

Lance Lyons

unread,
Mar 5, 2019, 10:58:34 AM3/5/19
to rabbitmq-users
Hi,

We have installed rabbitmq on windows machines with erlang, python, etc using the steps at the bottom.

this works and we have an instance running at 15672 (or 5672)

My question is how can I get a second or possible third instance running on this same box. 

Do we need to have separate installs?

I have seen mention of changing the  - RABBITMQ_NODENAME, RABBITMQ_BASE, RABBITMQ_NODE_PORT only and installing the service but it seems like this could mess over the instance that is currently working since I would be changing the config files for the working instance to setup the second instance.

Any guidance would be appreciated.





Steps

  • install erlang otp_win64_19.3.exe
  • Set ERLANG_HOME= C:\Program Files\erl8.3
  • install rabbitmq-server-3.6.10.exe to   C:\Program Files\RabbitMQ Server
  • install python  python-3.6.2-amd64.exe  to  E:\Python36
  • add  E:\Python36\Scripts\;E:\Python36\;  to PATH variable
  • in the C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.10\sbin  folder run


      rabbitmq-plugins enable rabbitmq_management

  • in a browser on the machine visit http//localhost:15672 to make sure the login screen comes up.
  • go to http://localhost:15672/cli and download the rabbitmqadmin
  • place this file in the C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.10\sbin

Luke Bakken

unread,
Mar 5, 2019, 12:19:42 PM3/5/19
to rabbitmq-users
Hi Lance,

Unless you're doing this for development purposes running a cluster on the same machine isn't recommended.

When I have to do this on Windows, I don't use the installer but instead use the .zip archive:


Extract, and you can run rabbitmq-server.bat in different console windows. Before running that batch file, set the following variables:

set RABBITMQ_NODENAME=rabbit2@HOSTNAME
set RABBITMQ_NODE_PORT=5673
set RABBITMQ_SERVER_START_ARGS='-rabbitmq_management listener [{port,15673}]'

Use rabbit3, 5674 and 15674 for the third node in another console window. Then, in yet another console you can set up the cluster.

Thanks,
Luke

Luke Bakken

unread,
Mar 5, 2019, 12:20:31 PM3/5/19
to rabbitmq-users
The last set statement should not use quotes.

set RABBITMQ_SERVER_START_ARGS=-rabbitmq_management listener [{port,15673}]

Lance Lyons

unread,
Mar 5, 2019, 1:20:49 PM3/5/19
to rabbitm...@googlegroups.com
Hi Luke,  Thanks for the info.   That helps.    In terms of your statement of doing this only for development purposes, what is the recommended approach for scenarios where you need multiple rabbitmq instances for different processes? for instance, in a staging environment we might have 2 different apps with different processes using rabbitmq.  I dont want to have a dedicated machine for each since this seems to be overkill particularly in a non production environment.

what if we had the same scenario in a production environment.. would you have both apps use the same rabbitmq instance with different queues and exchanges or is the best practice to have separate and dedicated machines?

Thanks in advance

Lance

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luke Bakken

unread,
Mar 5, 2019, 2:07:18 PM3/5/19
to rabbitmq-users
Hi Lance,

You can use virtual hosts to have a unique set of exchanges, queues and other entities in your RabbitMQ instance: https://www.rabbitmq.com/vhosts.html

You really only need dedicated machines if, via benchmarks, you determine that a single instance can't handle your load.

Thanks,
Luke

Lance Lyons

unread,
Mar 6, 2019, 11:49:40 AM3/6/19
to rabbitmq-users

Thanks Luke,


Need a little more help.   I followed your advice on using the zip file and extracted that on the same box that I have already installed the first instance.  Using the same server version as well.   I have set the variables as you mentioned and tried to run the rabbitmq-server.bat as well as trying to install as a service (this is ideal for me)

this is what I see.

C:\Program Files\RabbitMQ_Server-5673\sbin>set RABBITMQ_NODENAME=rabbit5673@HOSTNAME

C:\Program Files\RabbitMQ_Server-5673\sbin>set RABBITMQ_NODE_PORT=5673

C:\Program Files\RabbitMQ_Server-5673\sbin>set RABBITMQ_SERVER_START_ARGS=-rabbitmq_management listener [{port,15673}]

C:\Program Files\RabbitMQ_Server-5673\sbin>rabbitmq-service.bat install
RabbitMQ Server 2  service is already present - only updating service parameters
C:\Program Files\erl8.3\erts-8.3\bin\erlsrv: Unrecognized option Server.

C:\Program Files\RabbitMQ_Server-5673\sbin>rabbitmq-server.bat
ERROR: epmd error for host HOSTNAME: nxdomain (non-existing domain)

C:\Program Files\RabbitMQ_Server-5673\sbin>hostname
QABRW-MDBRBT01

C:\Program Files\RabbitMQ_Server-5673\sbin>set RABBITMQ_NODENAME=rabbit5673@QABRW-MDBRBT01

C:\Program Files\RabbitMQ_Server-5673\sbin>rabbitmq-server.bat
ERROR: epmd error for host HOSTNAME: nxdomain (non-existing domain)


I am continuing to look but if you had seen error before and have any suggestions that would be appreciated.

thanks
Lance

Luke Bakken

unread,
Mar 6, 2019, 11:53:44 AM3/6/19
to rabbitmq-users
Hi Lance,

You won't be able to install multiple windows service entries using the rabbitmq-service.bat command. You may be able to do it by copying registry keys and tweaking the arguments to erl.exe.

As for the nxdomain error, you're setting the node name to rabbit@HOSTNAME but your actual host name is QABRW-MDBRBT01. You should do this instead:

set RABBITMQ_NODENAME=rabbit2@QABRW-MDBRBT01

Thanks,
Luke

Lance Lyons

unread,
Mar 6, 2019, 5:23:25 PM3/6/19
to rabbitmq-users
Hi Luke,

Thanks.   I was able to get the 2nd and 3rd instance running successfully.  Now I am hoping to find a way to have these run as a windows service since I have to physically login to the server to have them startup in console.

Have you heard of folks successfully getting other instances running as a service?

I had read about logging in as another administrator on the server and essentially running rabbitmq-service.exe  install after setting node name, port, etc.

Luke Bakken

unread,
Mar 6, 2019, 5:46:05 PM3/6/19
to rabbitmq-users
Hi Lance,

You won't be able to use the installer to install multiple services on the same machine, but you can use rabbitmq-service.bat afterward to install additional service instances.

Using the same administrative account that installed RabbitMQ, open a "RabbitMQ Command Prompt (sbin dir)" prompt and set the environment variables you have set below, and set one more:

set RABBITMQ_SERVICENAME=RabbitMQ-2

Then, run .\rabbitmq-service.bat install and the second service instance should be installed as RabbitMQ-2. You'll just have to remember to set this environment variable if you want to manage a non-default-named service. Start it up with .\rabbitmq-service.bat start

Let me know if you need more assistance.

Lance Lyons

unread,
Mar 6, 2019, 9:48:21 PM3/6/19
to rabbitm...@googlegroups.com
Would that setup the second instance using different node names and ports or would I need to define those first and avoid using the same configs for the original install at 5672.



--

Luke Bakken

unread,
Mar 7, 2019, 8:33:11 AM3/7/19
to rabbitmq-users
Hi Lance,

That's why I wrote "set the environment variables you have set below". If you look at rabbitmq-service.bat you'll see that environment variables like RABBITMQ_NODENAME are used to build an argument list that the windows service uses when it starts.

set RABBITMQ_SERVICENAME=RabbitMQ-5673
set RABBITMQ_NODENAME=rabbit5673@HOSTNAME
set RABBITMQ_NODE_PORT=5673
set RABBITMQ_SERVER_START_ARGS=-rabbitmq_management listener [{port,15673}]
.\rabbitmq-service.bat install

Lance Lyons

unread,
Mar 7, 2019, 9:58:01 AM3/7/19
to rabbitm...@googlegroups.com
Hi Luke,

I tried that before and it does install a new service and the service starts but RabbitMQ does not come up on the port 5673.  This is what I have in the log file.   Is there something else I need to do?

Thanks for your help on this.  its much appreciated.


=INFO REPORT==== 7-Mar-2019::08:52:50 ===
Starting RabbitMQ 3.6.10.903 on Erlang 19.3
Copyright (C) 2007-2017 Pivotal Software, Inc.
Licensed under the MPL.  See http://www.rabbitmq.com/

=INFO REPORT==== 7-Mar-2019::08:52:50 ===
node           : rabbitmq5673@IABRW-MDBRT01
home dir       : C:\Windows
config file(s) : c:/Users/LANCE_~1/AppData/Roaming/RabbitMQ/rabbitmq.config
cookie hash    : D+xLmf+NlPkE9AReiKUnRw==
log            : C:/Users/LANCE_~1/AppData/Roaming/RabbitMQ/log/RAEDB3~1.LOG
sasl log       : C:/Users/LANCE_~1/AppData/Roaming/RabbitMQ/log/RA8AB1~1.LOG
database dir   : c:/Users/LANCE_~1/AppData/Roaming/RabbitMQ/db/RAA14F~1

=INFO REPORT==== 7-Mar-2019::08:52:56 ===
Memory limit set to 3276 MiB (3435785420 bytes) of 8191 MiB (8589463552 bytes) total.

=INFO REPORT==== 7-Mar-2019::08:52:56 ===
Enabling free disk space monitoring

=INFO REPORT==== 7-Mar-2019::08:52:56 ===
Disk free limit set to 50MB

=INFO REPORT==== 7-Mar-2019::08:52:56 ===
Limiting to approx 8092 file handles (7280 sockets)

=INFO REPORT==== 7-Mar-2019::08:52:56 ===
FHC read buffering:  OFF
FHC write buffering: ON

=INFO REPORT==== 7-Mar-2019::08:52:56 ===
Database directory at c:/Users/LANCE_~1/AppData/Roaming/RabbitMQ/db/RAA14F~1 is empty. Initialising from scratch...

=INFO REPORT==== 7-Mar-2019::08:52:56 ===
Waiting for Mnesia tables for 30000 ms, 9 retries left

=INFO REPORT==== 7-Mar-2019::08:52:57 ===
Waiting for Mnesia tables for 30000 ms, 9 retries left

=INFO REPORT==== 7-Mar-2019::08:52:57 ===
Waiting for Mnesia tables for 30000 ms, 9 retries left

=INFO REPORT==== 7-Mar-2019::08:52:57 ===
Priority queues enabled, real BQ is rabbit_variable_queue

=INFO REPORT==== 7-Mar-2019::08:52:57 ===
Error description:
   {could_not_start,rabbit,
       {error,
           {{shutdown,
                {failed_to_start_child,rabbit_epmd_monitor,
                    {{badmatch,{error,nxdomain}},
                     [{rabbit_epmd_monitor,init,1,
                          [{file,"src/rabbit_epmd_monitor.erl"},{line,56}]},
                      {gen_server,init_it,6,
                          [{file,"gen_server.erl"},{line,328}]},
                      {proc_lib,init_p_do_apply,3,
                          [{file,"proc_lib.erl"},{line,247}]}]}}},
            {child,undefined,rabbit_epmd_monitor_sup,
                {rabbit_restartable_sup,start_link,
                    [rabbit_epmd_monitor_sup,
                     {rabbit_epmd_monitor,start_link,[]},
                     false]},
                transient,infinity,supervisor,
                [rabbit_restartable_sup]}}}}

Log files (may contain more information):
   C:/Users/LANCE_~1/AppData/Roaming/RabbitMQ/log/RAEDB3~1.LOG
   C:/Users/LANCE_~1/AppData/Roaming/RabbitMQ/log/RA8AB1~1.LOG


--

Luke Bakken

unread,
Mar 7, 2019, 10:47:23 AM3/7/19
to rabbitmq-users
Hi Lance,

I didn't realize you're using such an old version of RabbitMQ. It shouldn't matter, but I'm using the latest code to try to give assistance.

IABRW-MDBRT01 is the host name, correct, and you can ping it?

Could you please export the HKLM/SOFTWARE/Ericsson registry key and attach it to your response? I would like to see what values are being saved for this service.

Thanks,
Luke

Lance Lyons

unread,
Mar 7, 2019, 1:15:35 PM3/7/19
to rabbitm...@googlegroups.com
Hi Luke,  Thanks

Hope this will attach properly.  This is with one added instance.

--
Ericsson.reg

Luke Bakken

unread,
Mar 7, 2019, 1:19:07 PM3/7/19
to rabbitmq-users
Hey Lance,

The file attached but the export is in .reg format. Sorry I should have been clearer - would you mind exporting in .txt format? There should be a drop-down where you can select that.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

Lance Lyons

unread,
Mar 7, 2019, 1:33:53 PM3/7/19
to rabbitm...@googlegroups.com
Hi Luke,   Here is the file in .txt format.

Thanks again.

Hey Lance,

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
Ericsson.txt

Luke Bakken

unread,
Mar 7, 2019, 3:16:25 PM3/7/19
to rabbitmq-users
Hi Lance,

The values look correct (but there is one error that I will explain). I did the process as I explained to you using RabbitMQ 3.7.12 on my Windows 8.1 VM and RabbitMQ came up fine on port 5673. You can see the transcript attached.

The nxdomain error is usually due to the host name not being resolved in DNS. And, guess what? That's your issue too. Here is the node name for the service that starts up successfully:

rabbit@IABRW-MDBRBT01

Here it is for the one that won't come up:

rabbitmq5673@IABRW-MDBRT01

You're missing a B in the second host name. So, remove the service and re-install it using the correct node name:

rabbitmq5673@IABRW-MDBRBT01

Thanks -
Luke
rabbitmq-5673-transcript.txt

Lance Lyons

unread,
Mar 7, 2019, 3:31:54 PM3/7/19
to rabbitm...@googlegroups.com
Hi Luke, 

Man sorry about that.  I did not see that.  That was definitely the issue.

thanks again.

--

Luke Bakken

unread,
Mar 7, 2019, 4:08:17 PM3/7/19
to rabbitmq-users
No problem! I'm glad it's an easy fix.


On Thursday, March 7, 2019 at 12:31:54 PM UTC-8, Lance Lyons wrote:
Hi Luke, 

Man sorry about that.  I did not see that.  That was definitely the issue.

thanks again.
Reply all
Reply to author
Forward
0 new messages