[rabbitmq-discuss] Issue in creating a RabbitMQ Cluster

Tim Watson tim at rabbitmq.com
Tue Jul 3 01:56:48 BST 2012


On 02/07/2012 22:05, Aravindh S wrote:
> Hi.
>
> I am trying to create a cluster of three RabbitMQ nodes.
> I am having trouble setting the ".erlang.cookie" file correctly.
>
> Node1 - x.y.z.28        - Ubuntu 12.04 - RabbitMQ installed from
> repositories.
> Node2 - x.y.z.38        - Ubuntu 12.04 - RabbitMQ installed from
> repositories.
> Node3 - x.y.z.39        - Ubuntu 12.04 - RabbitMQ installed from
> repositories.
>
> Individually all the three nodes are working fine.
>
> Step 1 : copy the erlang magic cookie between the nodes
>
>   * I replace the /var/lib/rabbitmq/.erlang.cookie file in Node 2 with
>     that of Node 1
>   * ls -al shows the file is owned by "rabbitmq" user

make sure the permissions are tight enough (readable ONLY):

-r--------    1 t4    staff      20  8 Apr  2010 .erlang.cookie

>
> step 2 : I try to add Node2 to a cluster with Node1
>
>   * Every rabbitmqctl command fails like below
>
> root at rabbit3:/home/aravindh# rabbitmqctl cluster rabbit at 130.127.39.28
> <mailto:rabbit at 130.127.39.28>
> Clustering node rabbit at rabbit3 with ['rabbit at 130.127.39.28
> <mailto:rabbit at 130.127.39.28>'] ...
> Error: unable to connect to node rabbit at rabbit3: nodedown
> diagnostics:
> - nodes and their ports on rabbit3:
> [{rabbit,37223},{rabbitmqctl12238,44154}]
> - current node: rabbitmqctl12238 at rabbit3
> - current node home dir: /var/lib/rabbitmq
> - current node cookie hash: rMqeVIBUabtB2sZrvleTTQ==
>
>

Well why are you using an IP addr instead of hostname!? It looks like 
you're not even running rabbit on rabbit3. Have you actually run 
rabbitmq-server to start the broker? What does erl -sname rabbit look 
like on the local machine(s)?

> root at rabbit3:/home/aravindh# rabbitmqctl status
> Status of node rabbit at rabbit3 ...
> Error: unable to connect to node rabbit at rabbit3: nodedown
> diagnostics:
> - nodes and their ports on rabbit3:
> [{rabbit,37223},{rabbitmqctl12271,38179}]
> - current node: rabbitmqctl12271 at rabbit3
> - current node home dir: /var/lib/rabbitmq
> - current node cookie hash: rMqeVIBUabtB2sZrvleTTQ==
>

This is saying that the local node (rabbit at rabbit3) is not running. This 
is *probably* because your Erlang cookie's permissions aren't tight enough.

> Reverting back to the original .erlang.cookie file gets rid of the
> error, but I cannot proceed with cluster without this cookie step right ?
>

That is correct. Try making the permission on the cookie file more 
restrictive. Don't forget to start the broker and then try running 
`rabbitmqctl status` and see if you're up and running locally.



More information about the rabbitmq-discuss mailing list