RabbitMQ Windows - Start Server automatically

1,210 views
Skip to first unread message

Raffaele Garofalo

unread,
Jan 8, 2016, 5:28:19 AM1/8/16
to rabbitmq-users

We are working with RabbitMQ on a Windows Environment. At the moment I have installed RabbitMQ and it runs as a Service. It starts automatically as shown here:


enter image description here


But if I send a Message or if I query the server here: http://localhost:15672/#/queues the server returns 404


Now, if I open the Shell and hit this command:

rabbitmq-server

The server startup and I can send and receive messages and browse the administration page.


Questions:

  • What is the difference then between RabbitMQ Windows Service and RabbitMQ Server?
  • How can I have the RabbitMQ Server run as a daemon when the PC boot? Is there a command or configuration for that?

Jean-Sébastien Pédron

unread,
Jan 8, 2016, 5:33:23 AM1/8/16
to rabbitm...@googlegroups.com
On 08/01/2016 11:28, Raffaele Garofalo wrote:
> Questions:
>
> * What is the difference then between RabbitMQ Windows Service and
> RabbitMQ Server?

There are none: the Windows service just starts RabbitMQ like you did
from the command line.

> * How can I have the RabbitMQ Server run as a daemon when the PC boot?
> Is there a command or configuration for that?

The Windows service is here for this purpose. So we need to figure out
what's going on with your setup.

After making sure the Windows service is running, could you please post
the output of "rabbitmqctl.bat report"?

--
Jean-Sébastien Pédron
Pivotal / RabbitMQ

Raffaele Garofalo

unread,
Jan 8, 2016, 5:51:59 AM1/8/16
to rabbitmq-users, jean-se...@rabbitmq.com
So, if the Service is running I get this LOG

========================================================================================
Error: unable to connect to node 'rabbit@DESKTOP-4TC0MS7': nodedown

DIAGNOSTICS
===========

attempted to contact: ['rabbit@DESKTOP-4TC0MS7']

rabbit@DESKTOP-4TC0MS7:
  * connected to epmd (port 4369) on DESKTOP-4TC0MS7
  * epmd reports: node 'rabbit' not running at all
                  other nodes on DESKTOP-4TC0MS7: ['RabbitMQ']
  * suggestion: start the node

current node details:
- node name: 'rabbitmq-cli-10420@DESKTOP-4TC0MS7'
- home dir: C:\Users\raffa
- cookie hash: hXRZg8Foj+FXs7DwcLF6cg==
==================================================================

While if I open the SHELL and start Rabbitmq-server, I get this LOG 

==================================================================
Reporting server status on {{2016,1,8},{10,51,27}}

 ...
Status of node 'rabbit@DESKTOP-4TC0MS7' ...
[{pid,3176},
 {running_applications,

Jean-Sébastien Pédron

unread,
Jan 8, 2016, 5:56:24 AM1/8/16
to rabbitm...@googlegroups.com
On 08/01/2016 11:51, Raffaele Garofalo wrote:
> Error: unable to connect to node 'rabbit@DESKTOP-4TC0MS7': nodedown

What version of RabbitMQ are you using?

Still with the Windows service running, can you retry with
"rabbitmqctl.bat -n rabbit@desktop-4tc0ms7 report"? Ie. with the
hostname as lowercase.

Raffaele Garofalo

unread,
Jan 8, 2016, 6:00:06 AM1/8/16
to rabbitm...@googlegroups.com
I have RabbitMQ version 3.6.0 running on different machines.
All with the same problem Windows 2012R2 or Windows 10

So this time the LOG says:

Error: unable to connect to node 'rabbit@desktop-4tc0ms7': nodedown

DIAGNOSTICS
===========

attempted to contact: ['rabbit@desktop-4tc0ms7']

rabbit@desktop-4tc0ms7:
* connected to epmd (port 4369) on desktop-4tc0ms7
* epmd reports: node 'rabbit' not running at all
other nodes on desktop-4tc0ms7: ['RabbitMQ',
'rabbitmq-cli-11576']
* suggestion: start the node

current node details:
- node name: 'rabbitmq-cli-11576@DESKTOP-4TC0MS7'

Michael Klishin

unread,
Jan 8, 2016, 6:01:11 AM1/8/16
to rabbitm...@googlegroups.com, Raffaele Garofalo
On 8 January 2016 at 14:00:06, Raffaele Garofalo (raf...@gmail.com) wrote:
> Error: unable to connect to node 'rabbit@desktop-4tc0ms7':
> nodedown

What is in RabbitMQ log files? 
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Raffaele Garofalo

unread,
Jan 8, 2016, 6:09:24 AM1/8/16
to rabbitmq-users, raf...@gmail.com
I tried to delete the logs from here:

C:\Users\raffa\AppData\Roaming\RabbitMQ\log

Now, if I stop and start the service, the log folder is empty.

The Windows Service starts as following:

"C:\Program Files\erl7.2.1\erts-7.2.1\bin\erlsrv.exe"

But if I start rabbit using SHELL>rabbitmq-server the LOG is created

=INFO REPORT==== 8-Jan-2016::13:07:29 ===
Starting RabbitMQ 3.6.0 on Erlang 18.2.1
Copyright (C) 2007-2015 Pivotal Software, Inc.
Licensed under the MPL.  See http://www.rabbitmq.com/

=INFO REPORT==== 8-Jan-2016::13:07:29 ===
node           : rabbit@DESKTOP-4TC0MS7
home dir       : C:\Users\raffa
config file(s) : c:/Users/raffa/AppData/Roaming/RabbitMQ/rabbitmq.config (not found)
cookie hash    : hXRZg8Foj+FXs7DwcLF6cg==
log            : C:/Users/raffa/AppData/Roaming/RabbitMQ/log/rab...@DESKTOP-4TC0MS7.log
sasl log       : C:/Users/raffa/AppData/Roaming/RabbitMQ/log/rab...@DESKTOP-4TC0MS7-sasl.log
database dir   : c:/Users/raffa/AppData/Roaming/RabbitMQ/db/rabbit@DESKTOP-4TC0MS7-mnesia

=WARNING REPORT==== 8-Jan-2016::13:07:29 ===
Kernel poll (epoll, kqueue, etc) is disabled. Throughput and CPU utilization may worsen.

=WARNING REPORT==== 8-Jan-2016::13:07:29 ===
Erlang VM is running with 0 I/O threads, file I/O performance may worsen

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
Memory limit set to 6507MB of 16267MB total.

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
Disk free limit set to 50MB

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
Limiting to approx 8092 file handles (7280 sockets)

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
FHC read buffering:  OFF
FHC write buffering: ON

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
Priority queues enabled, real BQ is rabbit_variable_queue

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
Management plugin: using rates mode 'basic'

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
msg_store_transient: using rabbit_msg_store_ets_index to provide index

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
msg_store_persistent: using rabbit_msg_store_ets_index to provide index

=WARNING REPORT==== 8-Jan-2016::13:07:32 ===
msg_store_persistent: rebuilding indices from scratch

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
started TCP Listener on [::]:5672

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
started TCP Listener on 0.0.0.0:5672

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
Management plugin started. Port: 15672

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
Statistics database started.

=INFO REPORT==== 8-Jan-2016::13:07:32 ===
Server startup complete; 6 plugins started.
 * rabbitmq_management
 * rabbitmq_management_agent
 * rabbitmq_web_dispatch
 * webmachine
 * mochiweb
 * amqp_client

Jean-Sébastien Pédron

unread,
Jan 8, 2016, 6:29:10 AM1/8/16
to rabbitm...@googlegroups.com
On 08/01/2016 12:09, Raffaele Garofalo wrote:
> I tried to delete the logs from here:
>
> C:\Users\raffa\AppData\Roaming\RabbitMQ\log
>
> Now, if I stop and start the service, the log folder is empty.

So the service may not start at all. I already saw a couple times the
Services window incorrectly saying RabbitMQ was running. It's probably
an issue with RabbitMQ, not Windows, but I couldn't reproduce and fix it
so far.

My hypothesis is: Windows happily uses hostname as lowercase or
uppercase. However, Erlang treats hostnames as case sensitive. In
RabbitMQ 3.6.0, I tried to make sure we used lowercase hostnames, but
apparently, they are cases where this is not the case yet (your node
starts with the uppercase hostname when using the command line). So if
the Mnesia database was created with the uppercase and now, the node
wants to start with a lowercase hostname, it won't work (the reverse is
also true).

Can you try to move C:\Users\raffa\AppData\Roaming\RabbitMQ to another
place (or rename this directory), then try to start the service again?

Raffaele Garofalo

unread,
Jan 8, 2016, 6:36:00 AM1/8/16
to rabbitm...@googlegroups.com
I did and now the Folder RabbitMQ doesn't exist anymore, and it has not been re-created when I Started the service.

Also, the Service start from Windows/Services.msc but if I use the Command available from RabbitMQ installation (Start RabbitMQ Service)
the service does not start.
--
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/lbAS5ERtpNg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send an email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raffaele Garofalo

unread,
Jan 8, 2016, 12:57:31 PM1/8/16
to rabbitmq-users
Problem Solved

After further investigations I found out that all RabbitMQ have been installed before configuring the plugin rabbitmq_management and amqp_client so actually the Windows Service was running without doing anything.

I fixed the problem on all my server by doing these steps:
  1. Remove RabbitMQ using rabbitmq-service stop, rabbitmq-service remove
    Remember that the CMD must run under Administrator credentials on Windows 10 and Windows Server 2012
  2. Install the plugin using rabbitmq-plugins enable rabbitmq_management
  3. Start the Service rabbitmq-service start
Also, I restarted Windows and verified that after the reboot the RabbitMQ was up and running.

Again, thanks for your time 

Reply all
Reply to author
Forward
0 new messages