[rabbitmq-discuss] Running RabbitMQ as a Windows Service - Having some problems

144 views
Skip to first unread message

Eran Sandler

unread,
Aug 31, 2008, 3:48:24 PM8/31/08
to rabbitmq...@lists.rabbitmq.com

Hello all,


First time on the mailing list :-) I think RabbitMQ is great but I have a small problem running it as a Windows service.


I've tried numerous ways of running RabbitMQ as a Windows service on Windows 2003.


I've used erlsrv.exe with the following command:

erlsrv add rabbitmq_messagequeue -sname rabbit -args "-mnesia dir '\"C:/RabbitMQ/db/rabbit-mnesia\"' -boot start_sasl -s rabbit -sasl errlog_type error"


The service runs but rabbitmq isn't running if I run "rabbitmqctrl.bat status". I tried passing the rest of the arguments such as the log file location etc but that makes the service not run.


Any ideas?


Thanks in advance,

Eran

Ben Hood

unread,
Aug 31, 2008, 7:24:02 PM8/31/08
to Eran Sandler, rabbitmq
Eran,

On Sun, Aug 31, 2008 at 8:48 PM, Eran Sandler <eran.s...@gmail.com> wrote:
> I've tried numerous ways of running RabbitMQ as a Windows service on Windows
> 2003.
>
> I've used erlsrv.exe with the following command:
>
> erlsrv add rabbitmq_messagequeue -sname rabbit -args "-mnesia dir
> '\"C:/RabbitMQ/db/rabbit-mnesia\"' -boot start_sasl -s rabbit -sasl
> errlog_type error"
>
> The service runs but rabbitmq isn't running if I run "rabbitmqctrl.bat
> status". I tried passing the rest of the arguments such as the log file
> location etc but that makes the service not run.

First of all, I have not run erlsrv myself because I don't have access
to a windows machine, but I'm sure that this can achieved via VMware
soon.

However, I do know of somebody who has done this already with windows,
so I've prompted them for the solution, hopefully that will turn up
soon.

BTW, to clarify your question - are you saying that Rabbit is actually
running (meaning that you can connect to it via a client) and that the
rabbitmqctrl.bat is just returning the wrong status when it is
invoked?

HTH,

Ben

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq...@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Eran Sandler

unread,
Sep 1, 2008, 1:17:44 AM9/1/08
to Ben Hood, rabbitmq
Hi Ben,

Thanks for the response.

The Erlang process goes up (it seems erlsrv when started takes the process up) and I can telnet to port 5672 and get a response that contains the words AQMP (which is usually the quickest way I check if the service is up), but when I run "rabbitmqctrl status" it says the node is down.

Eran

Eran Sandler

unread,
Sep 1, 2008, 9:26:08 AM9/1/08
to Ben Hood, rabbitmq

I've managed to manually edit the arguments passed to the erlang interpreter by erlsrv and added all the necessary parameters for logging and for the db. So now I can start it as a Windows service and it seems to be working.


The log seems to behave correctly and when I telnet I see the log reporting on this.


When I run "rabbitmqctl status" I get the following error in the log:

** Connection attempt from disallowed node rabbitmqctl@yeddaweb7 **


Can it be a permissions problem of some kind? RabbitMQ's process runs under the Local system account while the process of rabbitmqctl runs under a local user.


Eran

Eran Sandler

unread,
Sep 1, 2008, 9:28:30 AM9/1/08
to Ben Hood, rabbitmq

Forgot to mention, this is the command line that evetually runs RabbitMQ:


"C:\Program Files (x86)\erl5.5.5\erts-5.5.5\bin\erl.exe" -service_event ErlSrv_rabbitmq_messagequeue -nohup -sname rabbit -mnesia dir \""C:/RabbitMQ/db/rabbit-mnesia"\" -boot start_sasl -s rabbit -sasl errlog_type error -kernel inet_default_listen_options "[{sndbuf, 16384}, {recbuf, 4096}]" -rabbit tcp_listeners "[{\"0.0.0.0\", 5672}]" -kernel error_logger {file,\""C:/RabbitMQ/log/rabbit.log"\"}  -sasl sasl_error_logger {file,\""C:/RabbitMQ/log/rabbit-sasl.log"\"}



Eran



Eran Sandler wrote:

Eran Sandler

unread,
Sep 1, 2008, 10:33:53 AM9/1/08
to Matthias Radestock, rabbitmq

I've tried running both on the same user account and it still didn't manage to access it.


What do I pass to the -setcookie <cookie> parameter (so I'll try that as well)


Eran


Matthias Radestock wrote:

Eran,

Eran Sandler wrote:
When I run "rabbitmqctl status" I get the following error in the log:

** Connection attempt from disallowed node rabbitmqctl@yeddaweb7 **


Can it be a permissions problem of some kind? RabbitMQ's process runs under the Local system account while the process of rabbitmqctl runs under a local user.

Erlang uses cookies to control which nodes are allowed to connect to each other. The cookie file lives in the user's home directory in the file .erlang.cookie.

Since in your setup the rabbitmqctl command is run by a different user than the RabbitMQ server, you need to either make the contents of the .erlang.cookie files the same or use the -setcookie <cookie> parameter to erl.exe to set the cookie explicitly.

Regards,

Matthias.

Matthias Radestock

unread,
Sep 1, 2008, 10:29:20 AM9/1/08
to Eran Sandler, rabbitmq
Eran,

Eran Sandler wrote:
> When I run "rabbitmqctl status" I get the following error in the log:
>
> ** Connection attempt from disallowed node rabbitmqctl@yeddaweb7 **
>
>
> Can it be a permissions problem of some kind? RabbitMQ's process runs
> under the Local system account while the process of rabbitmqctl runs
> under a local user.

Erlang uses cookies to control which nodes are allowed to connect to

each other. The cookie file lives in the user's home directory in the
file .erlang.cookie.

Since in your setup the rabbitmqctl command is run by a different user
than the RabbitMQ server, you need to either make the contents of the
.erlang.cookie files the same or use the -setcookie <cookie> parameter
to erl.exe to set the cookie explicitly.

Regards,

Matthias.

_______________________________________________

Matthias Radestock

unread,
Sep 1, 2008, 10:52:19 AM9/1/08
to Eran Sandler, rabbitmq
Eran Sandler wrote:
> What do I pass to the -setcookie <cookie> parameter (so I'll try that as
> well)

Anything, just as long as it's the same in both your server startup and
rabbitmqctl.

Reply all
Reply to author
Forward
0 new messages