Thanks.<div><br></div><div>How exactly could I make sure that:</div><div><br></div><div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
the same cookie used to start rabbit is the one used to run the administration commands.</blockquote><div><br></div><div>Is it done by comparing the string stored in $home/.erlang.cookie with something else?</div><br><div class="gmail_quote">
On Wed, May 16, 2012 at 12:02 PM, Alvaro Videla <span dir="ltr"><<a href="mailto:videlalvaro@gmail.com" target="_blank">videlalvaro@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
Please keep rabbitmq-discuss CC'ed
</div><div><br></div><div>Well, I really don't know how the macports thing works since I don't use it.</div><div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>More docs on the Erlang cookie are here <a href="http://erlang.org/doc/man/erl.html" target="_blank">http://erlang.org/doc/man/erl.html</a> see the -setcookie flag</div><div><br></div><div>Regards,</div>
<div><br></div><div>Alvaro</div><span class="HOEnZb"><font color="#888888">
<div><div><br></div><div>-- </div><div>Sent with <a href="http://www.sparrowmailapp.com/?sig" target="_blank">Sparrow</a></div><div><br></div></div></font></span><div class="HOEnZb"><div class="h5">
<p style="color:#a0a0a8">On Wednesday, May 16, 2012 at 5:46 PM, Merton Lister wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px">
<span><div><div>Hi Alvaro,<div><br></div><div>I've just noticed something here: <a href="http://www.rabbitmq.com/install-macports.html" target="_blank">http://www.rabbitmq.com/install-macports.html</a></div>
<div><br></div><div><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:18px;color:rgb(85,85,85);text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,sans-serif;word-spacing:0px">The </span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;font-weight:normal;line-height:18px;color:rgb(51,51,51);text-transform:none;font-size:13px;white-space:nowrap;font-family:'Courier New',Courier,monospace;word-spacing:0px">rabbitmq-server</span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:18px;color:rgb(85,85,85);text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,sans-serif;word-spacing:0px">, </span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;font-weight:normal;line-height:18px;color:rgb(51,51,51);text-transform:none;font-size:13px;white-space:nowrap;font-family:'Courier New',Courier,monospace;word-spacing:0px">rabbitmqctl</span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:18px;color:rgb(85,85,85);text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,sans-serif;word-spacing:0px">, and other RabbitMQ-related scripts on the path automatically (through sudo) </span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;display:inline!important;float:none;line-height:18px;color:rgb(85,85,85);text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,sans-serif;word-spacing:0px"><b>run in the context of the rabbitmq user</b></span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:18px;color:rgb(85,85,85);text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,sans-serif;word-spacing:0px">, so that the Erlang cookie can be read from (sudo)</span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;font-weight:normal;line-height:18px;color:rgb(51,51,51);text-transform:none;font-size:13px;white-space:nowrap;font-family:'Courier New',Courier,monospace;word-spacing:0px">$MACPORTS_PREFIX/var/lib/rabbitmq/.erlang.cookie</span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:18px;color:rgb(85,85,85);text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,sans-serif;word-spacing:0px">.</span></div>
<div><div style="text-align:left"><font color="#555555" face="Verdana, sans-serif"><span style="line-height:18px"><br></span></font></div><div style="text-align:left">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:</div>
<div style="text-align:left"><br></div><div style="text-align:left"><b>sudo -u rabbitmq rabbitmqctl stop</b></div><div style="text-align:left"><b><br></b></div><div style="text-align:left">Thanks!</div><div style="text-align:left">
<br></div><div style="text-align:left"><br></div><div style="text-align:left"><br></div><div style="text-align:left">Best,</div><div style="text-align:left">Merton</div><br><div>On Wed, May 16, 2012 at 11:29 AM, Merton Lister <span dir="ltr"><<a href="mailto:mrtnlstr@gmail.com" target="_blank">mrtnlstr@gmail.com</a>></span> wrote:<br>
<blockquote type="cite"><div><div><br></div>Thanks a lot.<div><div><br><br><div>On Wed, May 16, 2012 at 10:55 AM, Alvaro Videla <span dir="ltr"><<a href="mailto:videlalvaro@gmail.com" target="_blank">videlalvaro@gmail.com</a>></span> wrote:<br>
<blockquote type="cite"><div>No idea :) Maybe you installed rabbitmq before and that installer created that user?<div><br></div><div>Anyway… just do <b>sudo -u rabbitmq rabbitmqctl stop</b><span><font color="#888888"><br>
<br></font></span></div><span><font color="#888888"><div>-Alvaro</div></font></span><div><div><div><br><div>
On Wed, May 16, 2012 at 4:52 PM, Merton Lister <span dir="ltr"><<a href="mailto:mrtnlstr@gmail.com" target="_blank">mrtnlstr@gmail.com</a>></span> wrote:<br><blockquote type="cite"><div>
<div>Hi Alvaro,</div><div><br></div><div>Thanks for the pointer. This is my output:</div><div><br></div><div><div>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@mrtn-1 -boot /opt/local/var/lib/rabbitmq/mnesia/rabbit@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/<a href="mailto:rabbit@mrtn-1.log" target="_blank">rabbit@mrtn-1.log</a>"} -rabbit sasl_error_logger {file,"/opt/local/var/log/rabbitmq/<a href="mailto:rabbit@mrtn-1-sasl.log" target="_blank">rabbit@mrtn-1-sasl.log</a>"} -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@mrtn-1" -noshell -noinput</div>
<div>mrtn 13062 0.0 0.0 2435120 528 s000 R+ 9:57AM 0:00.00 grep rabbit</div><div>rabbitmq 6005 0.0 0.0 2435000 108 ?? S 4:05PM 0:00.00 inet_gethost 4</div><div>rabbitmq 6004 0.0 0.0 2434996 396 ?? Ss 4:05PM 0:00.01 inet_gethost 4</div>
<div>rabbitmq 5980 0.0 0.0 2435000 224 ?? S 4:05PM 0:00.50 /opt/local/lib/erlang/erts-5.9/bin/epmd -daemon</div></div><div><br></div><div>Strangely, why do I have a user named 'rabbitmq'?!</div><div>
<div><br>
<div>On Wed, May 16, 2012 at 9:28 AM, Alvaro Videla <span dir="ltr"><<a href="mailto:videlalvaro@gmail.com" target="_blank">videlalvaro@gmail.com</a>></span> wrote:<br><blockquote type="cite"><div>
<div>Hi,</div><div><br></div>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.<div><br></div><div>So if you want to gracefully stop that node you need to run <b>rabbitmqctl stop</b> with the same user that is running your current rabbitmq process.</div>
<div><br></div><div>To find that user try running: <b>ps aux | grep rabbit</b></div><span><font color="#888888"><div><br></div></font></span><div><span><font color="#888888">-Alvaro</font></span><div>
<div><br><br><div>On Wed, May 16, 2012 at 3:14 PM, Merton Lister <span dir="ltr"><<a href="mailto:mrtnlstr@gmail.com" target="_blank">mrtnlstr@gmail.com</a>></span> wrote:<br><blockquote type="cite"><div>Hi Tim,<div>
<br></div><div>Thanks for getting back to me. I am new to rabbitmq so not very familiar with the details you're asking for.</div>
<div><br></div><div>Here is what I see in /opt/local/var/lib/rabbitmq/.erlang.cookie:</div>
<div><br></div><div>QFZXZBPOMTJNACQIMJOT</div><div><br></div><div>and <span style="color:rgb(51,51,51);font-family:'Courier New',Courier,monospace;line-height:18px;white-space:nowrap">sudo rabbitmqctl status </span>gives me:</div>
<div><br></div><div><div><font face="'courier new', monospace">Status of node rabbit@h002 ...</font></div><div><div><font face="'courier new', monospace">Error: unable to connect to node rabbit@h002: nodedown</font></div>
<div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">DIAGNOSTICS</font></div><div><font face="'courier new', monospace">===========</font></div>
<div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">nodes in question: [rabbit@h002]</font></div><div><font face="'courier new', monospace"><br>
</font></div><div><font face="'courier new', monospace">hosts, their running nodes and ports:</font></div></div><div><font face="'courier new', monospace">- h002: [{rabbit,62428},{rabbitmqctl12565,55147}]</font></div>
<div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">current node details:</font></div><div><font face="'courier new', monospace">- node name: rabbitmqctl12565@h002</font></div>
<div>
<div><font face="'courier new', monospace">- home dir: /opt/local/var/lib/rabbitmq</font></div><div><font face="'courier new', monospace">- cookie hash: q7VU0JjCd0VG7jOEF9Hf/g==</font></div>
</div></div><div><br></div><div>I installed rabbitmq by following the instructions given here: <a href="http://www.rabbitmq.com/install-macports.html" target="_blank">http://www.rabbitmq.com/install-macports.html</a>, after which I ran <span style="color:rgb(51,51,51);font-family:'Courier New',Courier,monospace;line-height:18px;white-space:nowrap">sudo rabbitmq-server -detached</span> to start the server. Now I want to stop the server using <span style="color:rgb(51,51,51);font-family:'Courier New',Courier,monospace;line-height:18px;white-space:nowrap">sudo rabbitmqctl stop</span>, but it simply does not allow me to do so by the looks of it.</div>
<div><br></div><div>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.</div>
<div><br></div><div><br></div><div><br></div><div>Best,</div><div>Merton</div><div><div><div><br><div>On Wed, May 16, 2012 at 8:42 AM, tim <span dir="ltr"><<a href="mailto:tim@rabbitmq.com" target="_blank">tim@rabbitmq.com</a>></span> wrote:<br>
<blockquote type="cite"><div>On 16/05/2012 13:24, mrtn wrote:<br><blockquote type="cite"><div>
<br>
Hi,<br>
<br>
I installed the latest RabbitMQ via macports on OS X 10.6.8, and have<br>
been trying to run it on localhost. However, after I started the<br>
server using 'sudo rabbitmq-server -detached', I cannot stop the<br>
server/node, nor can I start a new one (as expected). Below is the<br>
output: first, I try to start a new server but failed because there is<br>
already running; second, I then try to stop the existing server/node<br>
but get told it is already down. Can anyone point out what is going on<br>
here?!<br>
<br>
mrtn:MyLab mrtn$ sudo rabbitmq-server -detached<br>
Activating RabbitMQ plugins ...<br>
0 plugins activated:<br>
<br>
node with name "rabbit" already running on "h002"<br>
<br>
DIAGNOSTICS<br>
===========<br>
<br>
nodes in question: [rabbit@h002]<br>
<br>
hosts, their running nodes and ports:<br>
- h002: [{rabbit,62428},{<u></u>rabbitmqprelaunch12073,54048}]<br>
<br>
current node details:<br>
- node name: rabbitmqprelaunch12073@h002<br>
- home dir: /opt/local/var/lib/rabbitmq<br>
- cookie hash: q7VU0JjCd0VG7jOEF9Hf/g==<br>
<br>
mrtn:MyLab mrtn$ sudo rabbitmqctl stop<br>
Stopping and halting node rabbit@h002 ...<br>
Error: unable to connect to node rabbit@h002: nodedown<br>
<br>
DIAGNOSTICS<br>
===========<br>
<br>
nodes in question: [rabbit@h002]<br>
<br>
hosts, their running nodes and ports:<br>
- h002: [{rabbit,62428},{<u></u>rabbitmqctl12108,54053}]<br>
<br>
current node details:<br>
- node name: rabbitmqctl12108@h002<br>
- home dir: /opt/local/var/lib/rabbitmq<br>
- cookie hash: q7VU0JjCd0VG7jOEF9Hf/g==<br>
______________________________<u></u>_________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.<u></u>rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/<u></u>cgi-bin/mailman/listinfo/<u></u>rabbitmq-discuss</a><br>
</div></blockquote><br>
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.<br>
<br>
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.<span><font color="#888888"><br>
<br>
Tim<br>
</font></span></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></div></blockquote></div><br></div></div></div>
</div></blockquote></div><br>
</div></div></div></blockquote></div><br></div>
</div></div></div></blockquote></div><br>
</div></div></div></blockquote></div><br></div>
</div></div></span>
</blockquote>
<div>
<br>
</div>
</div></div></blockquote></div><br></div>