rabbitmq-server start
2025-07-03 15:01:55.380000+08:00 [warning] <0.143.0> Using RABBITMQ_ADVANCED_CONFIG_FILE: c:/Users/Administrator/AppData/Roaming/RabbitMQ/advanced.config
2025-07-03 15:01:55.881000+08:00 [error] <0.143.0>
2025-07-03 15:01:55.881000+08:00 [error] <0.143.0> BOOT FAILED
2025-07-03 15:01:55.881000+08:00 [error] <0.143.0> ===========
2025-07-03 15:01:55.881000+08:00 [error] <0.143.0> ERROR: could not bind to distribution port 25672, it is in use by another node: rabbit@BF-202405311136
2025-07-03 15:01:55.881000+08:00 [error] <0.143.0>
BOOT FAILED
===========
ERROR: could not bind to distribution port 25672, it is in use by another node: rabbit@BF-202405311136
2025-07-03 15:01:56.898000+08:00 [error] <0.143.0> supervisor: {local,rabbit_prelaunch_sup}
2025-07-03 15:01:56.898000+08:00 [error] <0.143.0> errorContext: start_error
2025-07-03 15:01:56.898000+08:00 [error] <0.143.0> reason: {dist_port_already_used,25672,”rabbit”,”BF-202405311136″}2025-07-03 15:01:56.898000+08:00 [error] <0.143.0> offender: [{pid,undefined},
2025-07-03 15:01:56.898000+08:00 [error] <0.143.0> {id,prelaunch},
2025-07-03 15:01:56.898000+08:00 [error] <0.143.0> {mfargs,{rabbit_prelaunch,run_prelaunch_first_phase,[]}},
2025-07-03 15:01:56.898000+08:00 [error] <0.143.0> {restart_type,transient},
2025-07-03 15:01:56.898000+08:00 [error] <0.143.0> {significant,false},
2025-07-03 15:01:56.898000+08:00 [error] <0.143.0> {shutdown,5000},
2025-07-03 15:01:56.898000+08:00 [error] <0.143.0> {child_type,worker}]
2025-07-03 15:01:56.898000+08:00 [error] <0.143.0>
{exit,terminating,[{application_controller,call,2,[{file,”application_controller.erl”},{line,515}]},{application,’-ensure_all_started/3-lc$^0/1-0-‘,1,[{file,”application.erl”},{line,368}]},{application,ensure_all_started,3,[{file,”application.erl”},{line,368}]},{rabbit,’-start_it/1-fun-0-‘,1,[{file,”src/rabbit.erl”},{line,423}]},{timer,tc,2,[{file,”timer.erl”},{line,599}]},{rabbit,start_it,1,[{file,”src/rabbit.erl”},{line,421}]},{init,start_it,1,[{file,”init.erl”},{line,1569}]},{init,start_em,1,[{file,”init.erl”},{line,1544}]}]}
2025-07-03 15:01:56.898000+08:00 [notice] <0.45.0> Application rabbitmq_prelaunch exited with reason: {{shutdown,{failed_to_start_child,prelaunch,{dist_port_already_used,25672,”rabbit”,”BF-202405311136″}}},{rabbit_prelaunch_app,start,[normal,[]]}}
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> crasher:
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> initial call: application_master:init/3
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> pid: <0.141.0>
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> registered_name: []
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> exception exit: {{shutdown,
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> {failed_to_start_child,prelaunch,
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> {dist_port_already_used,25672,”rabbit”,
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> “BF-202405311136”}}},
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> {rabbit_prelaunch_app,start,[normal,[]]}}
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> in function application_master:init/3 (application_master.erl:147)
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> ancestors: [application_controller,<0.10.0>]
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> message_queue_len: 1
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> messages: [{‘EXIT’,<0.142.0>,normal}]
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> links: [<0.45.0>]
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> dictionary: []
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> trap_exit: true
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> status: running
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> heap_size: 376
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> stack_size: 29
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> reductions: 76
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0> neighbours:
2025-07-03 15:01:56.898000+08:00 [error] <0.141.0>
Kernel pid terminated (application_controller) (“{application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{dist_port_already_used,25672,\”rabbit\”,\”BF-202405311136\”}}},{rabbit_prelaunch_app,start,[normal,[]]}}}”)
Crash dump is being written to: erl_crash.dump…done
你遇到的 RabbitMQ 启动失败错误是这个:
ERROR: could not bind to distribution port 25672, it is in use by another node: rabbit@BF-202405311136
错误分析
RabbitMQ 默认使用 端口 25672 做为 Erlang 分布式节点通讯端口。
这个报错表示:
-
端口 25672 已被占用,通常是 另一个 RabbitMQ 实例已经启动了,或者之前的进程没释放端口。
解决方法
方法一:杀掉已占用 25672 的 RabbitMQ 进程(推荐)
1、打开命令行,执行:
netstat -ano | findstr 25672
输出:
TCP 0.0.0.0:25672 0.0.0.0:0 LISTENING 12345
其中 12345
是 PID(进程号)。
2、查一下是什么进程
tasklist /FI “PID eq 12345”
3、如果确定是 RabbitMQ,结束它:
taskkill /PID 12345 /F
4、然后重新启动:
rabbitmq-server start
方法二:彻底重启 RabbitMQ 服务
rabbitmq-service stop
rabbitmq-service start
或
net stop rabbitmq
net start rabbitmq
运行以下命令看是否已在运行:
rabbitmqctl status