[rabbitmq-discuss] Cannot start or stop RabbitMQ using rabbitmqctl

Alvaro Videla videlalvaro at gmail.com
Wed May 16 17:02:06 BST 2012


Please keep rabbitmq-discuss CC'ed  

Well, I really don't know how the macports thing works since I don't use it.

Those scripts you mention are simple shell scripts so they can be run by whatever user you choose, that's is not Erlang nor RabbitMQ specific.

Erlang will automatically create an .erlang.cookie in your home folder for you anyway. So you just need to make sure that the same cookie used to start rabbit is the one used to run the administration commands.

More docs on the Erlang cookie are here http://erlang.org/doc/man/erl.html see the -setcookie flag

Regards,

Alvaro  

--  
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Wednesday, May 16, 2012 at 5:46 PM, Merton Lister wrote:

> Hi Alvaro,
>  
> I've just noticed something here: http://www.rabbitmq.com/install-macports.html
>  
> The rabbitmq-server, rabbitmqctl, and other RabbitMQ-related scripts on the path automatically (through sudo) run in the context of the rabbitmq user, so that the Erlang cookie can be read from (sudo)$MACPORTS_PREFIX/var/lib/rabbitmq/.erlang.cookie.  
>  
> Does this mean that whenever I run rabbitmq-server on mac, it will always run as user 'rabbitmq', in which case, I will also have to stop it by using:  
>  
> sudo -u rabbitmq rabbitmqctl stop
>  
> Thanks!
>  
>  
>  
> Best,
> Merton
>  
> On Wed, May 16, 2012 at 11:29 AM, Merton Lister <mrtnlstr at gmail.com (mailto:mrtnlstr at gmail.com)> wrote:
> >  
> > Thanks a lot.
> >  
> >  
> > On Wed, May 16, 2012 at 10:55 AM, Alvaro Videla <videlalvaro at gmail.com (mailto:videlalvaro at gmail.com)> wrote:
> > > No idea :) Maybe you installed rabbitmq before and that installer created that user?
> > >  
> > > Anyway… just do sudo -u rabbitmq rabbitmqctl stop
> > >  
> > > -Alvaro
> > >  
> > > On Wed, May 16, 2012 at 4:52 PM, Merton Lister <mrtnlstr at gmail.com (mailto:mrtnlstr at gmail.com)> wrote:
> > > > Hi Alvaro,
> > > >  
> > > > Thanks for the pointer. This is my output:
> > > >  
> > > > rabbitmq  5991   0.4  0.2  2492192  16184   ??  S     4:05PM   1:56.45 /opt/local/lib/erlang/erts-5.9/bin/beam.smp -W w -K true -A30 -P 1048576 -- -root /opt/local/lib/erlang -progname erl -- -home /opt/local/var/lib/rabbitmq -- -noshell -noinput -sname rabbit at mrtn-1 -boot /opt/local/var/lib/rabbitmq/mnesia/rabbit at mrtn-1-plugins-expand/rabbit -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/opt/local/var/log/rabbitmq/rabbit at mrtn-1.log (mailto:rabbit at mrtn-1.log)"} -rabbit sasl_error_logger {file,"/opt/local/var/log/rabbitmq/rabbit at mrtn-1-sasl.log (mailto:rabbit at mrtn-1-sasl.log)"} -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/opt/local/var/lib/rabbitmq/mnesia/rabbit at mrtn-1" -noshell -noinput  
> > > > mrtn     13062   0.0  0.0  2435120    528 s000  R+    9:57AM   0:00.00 grep rabbit
> > > > rabbitmq  6005   0.0  0.0  2435000    108   ??  S     4:05PM   0:00.00 inet_gethost 4
> > > > rabbitmq  6004   0.0  0.0  2434996    396   ??  Ss    4:05PM   0:00.01 inet_gethost 4
> > > > rabbitmq  5980   0.0  0.0  2435000    224   ??  S     4:05PM   0:00.50 /opt/local/lib/erlang/erts-5.9/bin/epmd -daemon
> > > >  
> > > >  
> > > > Strangely, why do I have a user named 'rabbitmq'?!
> > > >  
> > > > On Wed, May 16, 2012 at 9:28 AM, Alvaro Videla <videlalvaro at gmail.com (mailto:videlalvaro at gmail.com)> wrote:
> > > > > Hi,
> > > > >  
> > > > > Basically the erlang.cookie belongs to a particular user. So the Erlang will load the cookie of the user running the commands rabbitmqctl, rabbitmq-server and so on.
> > > > >  
> > > > > So if you want to gracefully stop that node you need to run rabbitmqctl stop with the same user that is running your current rabbitmq process.  
> > > > >  
> > > > > To find that user try running: ps aux | grep rabbit
> > > > >  
> > > > > -Alvaro
> > > > >  
> > > > >  
> > > > > On Wed, May 16, 2012 at 3:14 PM, Merton Lister <mrtnlstr at gmail.com (mailto:mrtnlstr at gmail.com)> wrote:
> > > > > > Hi Tim,
> > > > > >  
> > > > > > Thanks for getting back to me. I am new to rabbitmq so not very familiar with the details you're asking for.  
> > > > > >  
> > > > > > Here is what I see in /opt/local/var/lib/rabbitmq/.erlang.cookie:  
> > > > > >  
> > > > > > QFZXZBPOMTJNACQIMJOT
> > > > > >  
> > > > > > and sudo rabbitmqctl status gives me:  
> > > > > >  
> > > > > > Status of node rabbit at h002 ...
> > > > > > Error: unable to connect to node rabbit at h002: nodedown
> > > > > >  
> > > > > > DIAGNOSTICS
> > > > > > ===========
> > > > > >  
> > > > > > nodes in question: [rabbit at h002]
> > > > > >  
> > > > > > hosts, their running nodes and ports:
> > > > > > - h002: [{rabbit,62428},{rabbitmqctl12565,55147}]
> > > > > >  
> > > > > > current node details:
> > > > > > - node name: rabbitmqctl12565 at h002
> > > > > > - home dir: /opt/local/var/lib/rabbitmq
> > > > > > - cookie hash: q7VU0JjCd0VG7jOEF9Hf/g==
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > > I installed rabbitmq by following the instructions given here: http://www.rabbitmq.com/install-macports.html, after which I ran sudo rabbitmq-server -detached to start the server. Now I want to stop the server using sudo rabbitmqctl stop, but it simply does not allow me to do so by the looks of it.  
> > > > > >  
> > > > > > I wonder what causes this kind of behavior? Am I running *multiple* rabbitmq servers/nodes on my machine now, and somehow I am not allowed to access some of them? Your help is much appreciated. Thanks.  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > > Best,
> > > > > > Merton
> > > > > >  
> > > > > > On Wed, May 16, 2012 at 8:42 AM, tim <tim at rabbitmq.com (mailto:tim at rabbitmq.com)> wrote:
> > > > > > > On 16/05/2012 13:24, mrtn wrote:
> > > > > > > >  
> > > > > > > > Hi,
> > > > > > > >  
> > > > > > > > I installed the latest RabbitMQ via macports on OS X 10.6.8, and have
> > > > > > > > been trying to run it on localhost. However, after I started the
> > > > > > > > server using 'sudo rabbitmq-server -detached', I cannot stop the
> > > > > > > > server/node, nor can I start a new one (as expected). Below is the
> > > > > > > > output: first, I try to start a new server but failed because there is
> > > > > > > > already running; second, I then try to stop the existing server/node
> > > > > > > > but get told it is already down. Can anyone point out what is going on
> > > > > > > > here?!
> > > > > > > >  
> > > > > > > > mrtn:MyLab mrtn$ sudo rabbitmq-server -detached
> > > > > > > > Activating RabbitMQ plugins ...
> > > > > > > > 0 plugins activated:
> > > > > > > >  
> > > > > > > > node with name "rabbit" already running on "h002"
> > > > > > > >  
> > > > > > > > DIAGNOSTICS
> > > > > > > > ===========
> > > > > > > >  
> > > > > > > > nodes in question: [rabbit at h002]
> > > > > > > >  
> > > > > > > > hosts, their running nodes and ports:
> > > > > > > > - h002: [{rabbit,62428},{rabbitmqprelaunch12073,54048}]
> > > > > > > >  
> > > > > > > > current node details:
> > > > > > > > - node name: rabbitmqprelaunch12073 at h002
> > > > > > > > - home dir: /opt/local/var/lib/rabbitmq
> > > > > > > > - cookie hash: q7VU0JjCd0VG7jOEF9Hf/g==
> > > > > > > >  
> > > > > > > > mrtn:MyLab mrtn$ sudo rabbitmqctl stop
> > > > > > > > Stopping and halting node rabbit at h002 ...
> > > > > > > > Error: unable to connect to node rabbit at h002: nodedown
> > > > > > > >  
> > > > > > > > DIAGNOSTICS
> > > > > > > > ===========
> > > > > > > >  
> > > > > > > > nodes in question: [rabbit at h002]
> > > > > > > >  
> > > > > > > > hosts, their running nodes and ports:
> > > > > > > > - h002: [{rabbit,62428},{rabbitmqctl12108,54053}]
> > > > > > > >  
> > > > > > > > current node details:
> > > > > > > > - node name: rabbitmqctl12108 at h002
> > > > > > > > - home dir: /opt/local/var/lib/rabbitmq
> > > > > > > > - cookie hash: q7VU0JjCd0VG7jOEF9Hf/g==
> > > > > > > > _______________________________________________
> > > > > > > > rabbitmq-discuss mailing list
> > > > > > > > rabbitmq-discuss at lists.rabbitmq.com (mailto:rabbitmq-discuss at lists.rabbitmq.com)
> > > > > > > > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> > > > > > >  
> > > > > > > Is the existing rabbit running with the same Erlang cookie as the new one? The cookie hash produced by rabbitmqctl is for the current node, not the one you're attempting to contact.
> > > > > > >  
> > > > > > > The list of nodes/ports on the given host indicates which Erlang nodes are up, but not necessarily whether they're allowed to connect to or not. Check your cookie and let us know how you get on.
> > > > > > >  
> > > > > > > Tim
> > > > > >  
> > > > > >  
> > > > > > _______________________________________________
> > > > > > rabbitmq-discuss mailing list
> > > > > > rabbitmq-discuss at lists.rabbitmq.com (mailto:rabbitmq-discuss at lists.rabbitmq.com)
> > > > > > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120516/250c0cda/attachment.htm>


More information about the rabbitmq-discuss mailing list