集群部署的时候,自己笔记本安装3台centos7 服务器【102,103,104】,各种前期准备好后,执行rabbitmqctl cluster_status发现报错,第一个想到的是cookie可能不对,检查发现三台.erlang.cookie都是一样的,仔细一看是103我改过hostname,重启后,从102拷贝过来发现还是报错,我就直接删掉了.erlang.cookie,然后又从102拷贝过来,启动rabbitmq-server start报错,提示信息如下
22:18:50.203 [error] ===========
===========
22:18:50.204 [error] ERROR: distribution port 25672 in use by another node: rabbit@node02
ERROR: distribution port 25672 in use by another node: rabbit@node02
22:18:50.204 [error]
22:18:51.206 [error] Supervisor rabbit_prelaunch_sup had child prelaunch started with rabbit_prelaunch:run_prelaunch_first_phase() at undefined exit with reason {dist_port_already_used,25672,"rabbit","node02"} in context start_error
22:18:51.206 [error] CRASH REPORT Process <0.157.0> with 0 neighbours exited with reason: {{shutdown,{failed_to_start_child,prelaunch,{dist_port_already_used,25672,"rabbit","node02"}}},{rabbit_prelaunch_app,start,[normal,[]]}} in application_master:init/4 line 138
{"Kernel pid terminated",application_controller,"{application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{dist_port_already_used,25672,\"rabbit\",\"node02\"}}},{rabbit_prelaunch_app,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{dist_port_already_used,25672,"rabbit","node02"}}},{rabbit_pre
Crash dump is being written to: erl_crash.dump...done
用有道词典翻译下:
先查找进程 netstat -lnp | grep 25672
然后杀掉进程kill -9 xxx
重启rabbitmq-server –detached发现25672没有端口,重新firewall-cmd --add-port=25672/tcp --permanent开通端口
最后再重启一次rabbitmq-server start 成功!