一、rabbitmq重装之后无法加入原有cluster

[root@compute1 ~]# rabbitmqctl join_cluster rabbit@controller
Clustering node rabbit@compute1 with rabbit@controller ...
Error: {cannot_start_mnesia,
           {{shutdown,{failed_to_start_child,mnesia_kernel_sup,killed}},
            {mnesia_sup,start,[normal,[]]}}}

[root@compute1 ~]# rabbitmqctl start_app
Starting node rabbit@compute1 ...
BOOT FAILED
===========
Error description:
   {error,{inconsistent_cluster,"Node rabbit@compute1 thinks it‘s clustered with node rabbit@controller, but rabbit@controller disagrees"}}
Log files (may contain more information):
   /var/log/rabbitmq/[email protected]
   /var/log/rabbitmq/[email protected]
Stack trace:
   [{rabbit_mnesia,check_cluster_consistency,0,
                   [{file,"src/rabbit_mnesia.erl"},{line,598}]},
    {rabbit,‘-start/0-fun-0-‘,0,[{file,"src/rabbit.erl"},{line,260}]},
    {rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,296}]},
    {rpc,‘-handle_call_call/6-fun-0-‘,5,[{file,"rpc.erl"},{line,206}]}]
Error: {error,{inconsistent_cluster,"Node rabbit@compute1 thinks it‘s clustered with node rabbit@controller, but rabbit@controller disagrees"}}

因为controller node是新安装,其icook信息也复制过去。compute1 node也执行stop_app,故应该推测应该是compute1 node之前残留的cluster信息,导致认证失败
在网上查询到因为mnesia的信息残留,故会认证失败。
其目录为/var/lib/rabbitmq/mnesia

mv /var/lib/rabbitmq/mnesia /tmp

重启rabbitmq之后再次尝试加入集群:


rabbitmqctl join_cluster rabbit@controller