<div dir="ltr">You will have one Erlang cookie per user that started a distributed Erlang VM. Say you run RrabbitMQ as the user "rabbit". Erlang will create a cookie for that user.<div><br></div><div>Then with your own user you try to run rabbitmqctl. That will create an Erlang cookie in your home folder, and that cookie _won't_ match the one created for RabbitMQ. What you have to do is either make sure both files have the same content, or set the cookie during startup, or update it afterwards to match the one of the other node you are trying to connect to.</div>
<div><br></div><div>See: <a href="http://www.erlang.org/doc/reference_manual/distributed.html#id83622">http://www.erlang.org/doc/reference_manual/distributed.html#id83622</a><br></div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Fri, Sep 13, 2013 at 3:45 PM, Ben Hsu <span dir="ltr"><<a href="mailto:ben.hsu@criticalmedia.com" target="_blank">ben.hsu@criticalmedia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p style="margin:0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="4" style="font:13.0px Helvetica">Thank you Alvaro,</font></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Helvetica;min-height:16.0px"><br></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="4" style="font:13.0px Helvetica">I understand<span> </span>the difference between rabbitmq-server and rabbitmqctl now.</font></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Helvetica;min-height:16.0px"><br></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="4" style="font:13.0px Helvetica">I'm still not able to copy or edit the Erlang cookie without killing the process. I see two different .erlang.cookie files: one in /var/lib/rabbitmq and one in the users home directory. I copied the first to the second and still got the "unable to connect" problem</font></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Helvetica;min-height:16.0px"><br></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="4" style="font:13.0px Helvetica">I am running version 3.1.3.1 on CentOS</font></p>
<div><span style="font-family:helvetica,arial;font-size:13px"></span>-- Ben Hsu<span>Sent with <a href="http://airmailapp.com/tracking" target="_blank">Airmail</a></span></div><div class="HOEnZb"><div class="h5"> <br><p style="color:#a0a0a8">
On September 13, 2013 at 7:39:41 PM, Ben Hsu (<a href="mailto:ben.hsu@criticalmedia.com" target="_blank">ben.hsu@criticalmedia.com</a>) wrote:</p> <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px">
<span><div>The Erlang cookie belongs to each particular user on your machines. The cookie can be found on ~/.erlang.cookie and you need to have the same value there for every node in the cluster.<div><br></div><div>start_app stops the Rabbit application inside the Erlang VM but the VM has to be running for that to work. </div>
<div><br></div><div>stop_app will stop the rabbit app, but not the Erlang VM</div><div><br></div><div>rabbitmq-server takes care of preparing the env parameters and starting the Erlang VM to then run RabbitMQ on it.</div>
<div><br></div><div>Regards,</div><div><br></div><div>Alvaro<span></span><br><br>On Friday, September 13, 2013, Ben Hsu wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">Hello all</div><div style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"><br>
</div><div style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">I need to change the erlang cookie on my RabbitMQ server to get clustering working, and wish to know the correct procedure.</div><div style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">
<br></div><div style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">I tried doing this:</div><div style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto"><br></div><div style="font-family:Helvetica,Arial;margin:0px">
rabbitmqctl stop_app</div><div style="font-family:Helvetica,Arial;margin:0px">vi /var/lib/rabbitmq/.erlang.cookie</div><div style="font-family:Helvetica,Arial;margin:0px"></div><div style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">
rabbitmqctl start_app # this gave me an error message: <i>Error: unable to connect to node 'rabbit@ben-amqp-test4': nodedown</i></div><div style="font-family:Helvetica,Arial;font-size:13px;margin:0px;line-height:auto">
<div><br></div><div>By trial and error, I found this worked:</div><div>pkill beam</div><div>pkill epmd</div><div style="margin:0px">vi /var/lib/rabbitmq/.erlang.cookie</div><div style="margin:0px"></div><div>rabbitmq-server </div>
<div># now in a separate window, for some reason it didn't work with rabbitmq-server -detached</div><div>rabbitmqctl start_app</div><div><br></div><div>That seemed to work, but is ugly, and doesn't feel like the right way of doing it.</div>
<div><br></div><div>Also, what is the difference between "rabbitmqctl start_app" and "rabbitmq-server"?</div><div><br></div><div>Thanks in advance</div></div><div><div><div> </div></div></div><br><div>
<span style="font-family:helvetica,arial;font-size:13px"></span>-- <br>Ben Hsu<br><span>Sent with <a href="http://airmailapp.com/tracking" target="_blank">Airmail</a></span></div></div></blockquote></div>
</div></span></blockquote></div></div></blockquote></div><br></div>