I'm trying to cluster two RabbitMQs.
I have two machines (rabbit1 & rabbit2) with Debian Wheezy running rabbitmq-server 2.8.4-1
. (I know that's old, but that's what comes with Debian Wheezy.)
On rabbit1 I run...
# rabbitmqctl stop_app
Stopping node rabbit@rabbit1 ...
...done.
# rabbitmqctl reset
Resetting node rabbit@rabbit1 ...
...done.
# rabbitmqctl cluster rabbit@rabbit2
Clustering node rabbit@rabbit1 with [rabbit@rabbit2] ...
Error: {no_running_cluster_nodes,[rabbit@rabbit2],[rabbit@rabbit2]}
But I don't get past this error. What am I missing?
Things I checked:
/etc/hosts
and can ping each machine from the other (using only rabbit1, resp. rabbit2 as a name).Update:
From rabbit1 I verfied with nmap that epmd on rabbit2 is listening on 4369.
root@rabbit1:~# nmap -p 1- rabbit2
...
PORT STATE SERVICE
4369/tcp open epmd
5672/tcp open amqp
51629/tcp open unknown
Solution: (Cheating)
It was neither the erlang cookie, nor the hostnames, nor the firewall. Actually I still don't know what it was. But I finally upgraded to RabbitMQ 3.5.4 by installing the Debian package provided by RabbitMQ. (I know this is cheating.) After the upgrade everything worked as expected with no further changes to my setup.
答案 0 :(得分:0)
我也遇到了这个问题,结果证明是我的.erlang.cookie
,尽管我确信我会在两台机器上将它们设置为相同的值(总是很好来仔细检查)。
可能会使用另一个.erlang.cookie
,具体取决于rabbitmq的启动方式。如果已使用init脚本启动,那么/var/lib/rabbitmq/.erlang.cookie
应该是正确的。如果您像这样开始使用rabbitmq rabbitmq-server -detached
,那么它可能位于用户的主目录中。
您可以通过运行-n
来检查rabbitmqctl正在使用的cookie哈希(如果它可以在您不提供rabbitmqctl -n notarealnode status
标志时连接,则与rabbitmq-server相同)将打印出来诊断
主机名也可能很棘手,因为本地节点和远程节点都需要相互识别,并且自己具有相同的名称。换句话说,rabbit1
的
另外,你没有提到你在哪里运行它,但是我的EC2 VPC中的这个意味着我必须设置安全组以允许节点之间的流量。如果您不在EC2中,那么可能还有其他类型的外部防火墙需要配置。