Error while installing RabbitMQ Service on Windows

1,978 views
Skip to first unread message

Fanliver Phạm

unread,
Oct 30, 2017, 10:21:06 PM10/30/17
to rabbitmq-users

I want to install RabbitMQ Service as a Windows Service. I see an option to install RabbitMQ Service from installer (v3.6.5). However, it does not work.

I write a Batch script trying to re-install RabbitMQ service after running installer file.

set HOMEDRIVE=C:
set HOMEPATH=\Users\%username%

call "C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.5\sbin\rabbitmq-service.bat" remove
call "C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.5\sbin\rabbitmq-service.bat" install

call net start RabbitMQ

call "C:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.5\sbin\rabbitmq-plugins.bat" enable rabbitmq_management

However, this script is quite unstable. Sometimes it works, but sometimes it doesn't.

I tested in many PCs with Windows 10, Windows 8.1, Windows 7 and Windows Server 2012.

When error occurs, it always occurs in the last command (enabling RabbitMQ management)

C:\Program Files\erl9.0\erts-9.0\bin\erlsrv: Service RabbitMQ removed from system.
C:\Program Files\erl9.0\erts-9.0\bin\erlsrv: Service RabbitMQ added to system.
The RabbitMQ service is starting.
The RabbitMQ service was started successfully.

Plugin configuration unchanged.

Applying plugin configuration to rabbit@<myhost>... failed.
* Could not contact node rabbit@<myhost>.
Changes will take effect at broker restart.
* Options: --online  - fail if broker cannot be contacted.
--offline - do not try to contact broker.

Sometimes, I got this error

...
Plugin configuration unchanged.

Applying plugin configuration to rabbit@<myhost>... failed.
Error: noproc

In my PC, I get the first error (could not contact node...) when %HOMEDRIVE%%HOMEPATH% is C:\users\myusername. When I change to C:\Windows, it works well. Then I change back to C:\users\, it also works well, no more error.

However, on a server with Windows Server 2012, even C:\Windows does not work (could not contact node...).

In all PCs, I see .erlang.cookie file in both C:\Windows and C:\Users\[username]. (I don't know anything about erlang, just follow some instructions from other questions in StackOverFlow).

What is wrong with my script?

  1. 1. Is the error related to the version of RabbitMQ? I am not using the latest version.

  2. 2. Is it related to Erlang? I guess if Erlang caused this problem, then two commands about removing/installing RabbitMQ service would be failed.

  3. 3. Is it able to install the service without checking service option from installer, just run command rabbitmq-service.bat install?

I posted this question on StackOverFlow and got one answer from Mr Luke Bakken (Thank you for your support).

However, after using the latest versions of RabbitMQ, installing both Erlang and RabbitMQ as admin, I still got the same problem.
- Without changing HOMEDRIVE and HOMEPATH variables, RabbitMQ's bat scripts or Erlang always tried to create cookie on P: drive (One remark: On my company's PCs, P: drive is mounted to a remote directory)
- With changes in HOMEDRIVE and HOMEPATH varibale, I got same error ("noproc")

I have some more questions:
4. (a) Should I check RabbitMQ Service component in the installer or (b) skip it and use 'rabbit-service.bat install" to install service.
5. After enabling RabbitMQ Management (rabbitmq-plugins enable rabbitmq_management), should I re-install service? (As mentioned in the 3rd section of this article)

I really need a script to automatically install RabbitMQ service and enable management because I cannot ask my customer (as the users) to manually run every command to setup RabbitMQ.

Michael Klishin

unread,
Oct 31, 2017, 4:44:55 AM10/31/17
to rabbitm...@googlegroups.com
See http://www.rabbitmq.com/windows-quirks.html and https://groups.google.com/d/msg/rabbitmq-users/d0WK_IAyXyY/Obj98irwAwAJ.

You don't have to use C:\Windows, override the location to C:\RabbitMQ or similar path that does not
include your username (which very likely contains non-ASCII characters).

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Luke Bakken

unread,
Oct 31, 2017, 1:47:24 PM10/31/17
to rabbitmq-users
Hi Fanliver -

Give this a try -

* Uninstall RabbitMQ completely.
* Create this directory - C:\RabbitMQ
* Set the RABBITMQ_BASE system environment variable to C:\RabbitMQ. On Windows 10 you can set system environment variables via Control Panel > System > Advanced System Settings > Advanced > Environment Variables > System Variables > New. Please be sure to set the system-wide environment variable. You may wish to reboot at this point to ensure all sessions now have this variable available.
* Run the RabbitMQ installer.

You should see the log directory and data directory created in C:\RabbitMQ at this point. The Erlang cookie will be at C:\Windows\.erlang.cookie

I just verified this procedure using RabbitMQ 3.6.12 on my Windows 10 Pro virtual machine.

Please let me know how it goes -
Luke
Reply all
Reply to author
Forward
0 new messages