RabbitMQ启动失败

RabbitMQ启动失败问题原因:由于服务器异常宕机导致RabbitMQ挂掉,服务器恢复之后尝试启动MQ发现启动失败。报错信息如下[root@bogonrabbitMq]#rabbitmqctlstart_appError:unabletoperformanoperationonnode‘rabbit@iZbp128yw4rvtfbytgv4y7Z’.Pleaseseediagnosticsinformationandsuggestionsbelow.Mostcommonreaso

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全家桶1年46,售后保障稳定

问题原因: 由于服务器异常宕机导致RabbitMQ挂掉,服务器恢复之后尝试启动MQ发现启动失败。报错信息如下

[root@bogon rabbitMq]# rabbitmqctl start_app
Error: unable to perform an operation on node ‘rabbit@iZbp128yw4rvtfbytgv4y7Z’. Please see diagnostics information and suggestions below.

Most common reasons for this are:

  • Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
  • CLI tool fails to authenticate with the server (e.g. due to CLI tool’s Erlang cookie not matching that of the server)
  • Target node is not running

In addition to the diagnostics info below:

  • See the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more
  • Consult server logs on node rabbit@iZbp128yw4rvtfbytgv4y7Z
  • If target node is configured to use long node names, don’t forget to use –longnames with CLI tools

DIAGNOSTICS

attempted to contact: [rabbit@iZbp128yw4rvtfbytgv4y7Z]

rabbit@iZbp128yw4rvtfbytgv4y7Z:

  • connected to epmd (port 4369) on iZbp128yw4rvtfbytgv4y7Z
  • epmd reports node ‘rabbit’ uses port 25672 for inter-node and CLI tool traffic
  • can’t establish TCP connection to the target node, reason: timeout (timed out)
  • suggestion: check if host ‘iZbp128yw4rvtfbytgv4y7Z’ resolves, is reachable and ports 25672, 4369 are not blocked by firewall

Current node details:

  • node name: ‘rabbitmqcli-5146-rabbit@iZbp128yw4rvtfbytgv4y7Z’
  • effective user’s home directory: /var/lib/rabbitmq
  • Erlang cookie hash: mVWZ9hzwnH+BCsNzXPPxQA==

查看状态:

rabbitmqctl status
报错如下:

Error: unable to perform an operation on node ‘rabbit@iZbp128yw4rvtfbytgv4y7Z’. Please see diagnostics information and suggestions below.

Most common reasons for this are:

Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
CLI tool fails to authenticate with the server (e.g. due to CLI tool’s Erlang cookie not matching that of the server)
Target node is not running
In addition to the diagnostics info below:

See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
Consult server logs on node rabbit@iZbp128yw4rvtfbytgv4y7Z
If target node is configured to use long node names, don’t forget to use –longnames with CLI tools
DIAGNOSTICS

attempted to contact: [‘rabbit@iZbp128yw4rvtfbytgv4y7Z’]

rabbit@iZbp128yw4rvtfbytgv4y7Z:

connected to epmd (port 4369) on iZbp128yw4rvtfbytgv4y7Z
epmd reports: node ‘rabbit’ not running at all
no other nodes on iZbp128yw4rvtfbytgv4y7Z
suggestion: start the node
Current node details:

node name: ‘rabbitmqcli-11079-rabbit@iZbp128yw4rvtfbytgv4y7Z’
effective user’s home directory: /root
Erlang cookie hash: vVAgrz18VW8gDZQB2YRW8A==

解决:

有可能是因为我们停止的时候进程并未完全关闭或者是被其他应用占用,导致后续重启失败,rabbitmq没有启动.
Rabbitmq-server默认占用的端口号有:5672、15672、25672、4369
查询lsof -i :4369端口占用进程pidkill -9 pid杀死相关进程之后重启发现报错依旧,且4369端口kill时显示进程不存在但是重新查询端口占用发现另一个进程占用该端口
Error: unable to perform an operation on node ‘rabbit@iZbp128yw4rvtfbytgv4y7Z’.根据这段错误信息查询到有可能是ip映射问题,故在 /etc/hosts 文件做一个映射,就将hostname iZbp128yw4rvtfbytgv4y7Z与本机ip映射了一下。保存,source /etc/hosts 。启动MQ报错依旧
ifconfig #查询到本机内网IP为: 10.25.0.181
#方式一:
echo 10.25.0.181 iZbp128yw4rvtfbytgv4y7Z >> /etc/host #直接将映射内容写入host文件
#方式二:
vim /etc/hosts #按 i 进入编辑模式

添加一条ip映射到本机

10.25.0.181 iZbp128yw4rvtfbytgv4y7Z

Esc 退出编辑模式

:wq #保存文件并退出
source /etc/hosts #刷新映射文件 报错-bash: 127.0.0.1: 未找到命令 -bash: ::1: 未找到命令 -bash: 10.25.0.181: 未找到命令
本人最终解决方式
journalctl -xe #查看系统日志排查MQ启动失败原因
系统日志如下:

– Subject: Unit rabbitmq-server.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit rabbitmq-server.service has failed.

– The result is failed.
8月 19 11:15:38 iZbp128yw4rvtfbytgv4y7Z systemd[1]: Unit rabbitmq-server.service entered failed state.
8月 19 11:15:38 iZbp128yw4rvtfbytgv4y7Z systemd[1]: rabbitmq-server.service failed.
8月 19 11:15:48 iZbp128yw4rvtfbytgv4y7Z systemd[1]: rabbitmq-server.service holdoff time over, scheduling restart.
8月 19 11:15:48 iZbp128yw4rvtfbytgv4y7Z systemd[1]: Stopped RabbitMQ broker.
– Subject: Unit rabbitmq-server.service has finished shutting down
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit rabbitmq-server.service has finished shutting down.
8月 19 11:15:48 iZbp128yw4rvtfbytgv4y7Z systemd[1]: Starting RabbitMQ broker…
– Subject: Unit rabbitmq-server.service has begun start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit rabbitmq-server.service has begun starting up.
8月 19 11:15:49 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Configuring logger redirection
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: ## ## RabbitMQ 3.8.19
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: ## ##
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: ########## Copyright © 2007-2021 VMware, Inc. or its affiliates.
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: ###### ##
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: ########## Licensed under the MPL 2.0. Website: https://rabbitmq.com
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Erlang: 23.3.4.4 [emu]
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: TLS Library: OpenSSL – OpenSSL 1.0.2k-fips 26 Jan 2017
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Doc guides: https://rabbitmq.com/documentation.html
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Support: https://rabbitmq.com/contact.html
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Tutorials: https://rabbitmq.com/getstarted.html
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Monitoring: https://rabbitmq.com/monitoring.html
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Logs: /var/log/rabbitmq/rabbit@iZbp128yw4rvtfbytgv4y7Z.log
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: /var/log/rabbitmq/rabbit@iZbp128yw4rvtfbytgv4y7Z_upgrade.log
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Config file(s): (none)
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Starting broker…
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: BOOT FAILED
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: ===========
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Error during startup: {error,
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: {cannot_delete_plugins_expand_dir,
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: [“/var/lib/rabbitmq/mnesia/rabbit@iZbp128yw4rvtfbytgv4y7Z-plugins-expand”,
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: {cannot_delete,
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: “/var/lib/rabbitmq/mnesia/rabbit@iZbp128yw4rvtfbytgv4y7Z-plugins-expand/cowboy-2.8.0/ebin/cowboy_app.beam”,
8月 19 11:15:53 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: eacces}]}}
8月 19 11:15:55 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: {“Kernel pid terminated”,application_controller,”{application_start_failure,rabbit,{
{cannot_delete_plugins_expand_dir,[“/var/lib/rabbitmq/mnesia/rabbit@iZbp128yw4rvtfb
8月 19 11:15:55 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Kernel pid terminated (application_controller) ({application_start_failure,rabbit,{
{cannot_delete_plugins_expand_dir,[“/var/lib/rabbitmq/mnesia/rabbit@iZbp128yw4rvtfbyt
8月 19 11:15:55 iZbp128yw4rvtfbytgv4y7Z rabbitmq-server[16624]: Crash dump is being written to: /var/log/rabbitmq/erl_crash.dump…done
8月 19 11:15:55 iZbp128yw4rvtfbytgv4y7Z systemd[1]: rabbitmq-server.service: main process exited, code=exited, status=1/FAILURE
8月 19 11:15:55 iZbp128yw4rvtfbytgv4y7Z systemd[1]: Failed to start RabbitMQ broker.

删除/var/lib/rabbitmq/mnesia 目录下的rabbit@iZbp128yw4rvtfbytgv4y7Z.pid、rabbit@iZbp128yw4rvtfbytgv4y7Z、rabbit@iZbp128yw4rvtfbytgv4y7Z-plugins-expand后,再使用systemctl start rabbitmq-server启动,成功启动MQ。
注意 :文件中包含交换机队列及用户等信息,删除等于重置MQ(队列会被清空),请谨慎操作

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/219974.html原文链接:https://javaforall.net

(0)
上一篇 2025年7月4日 下午9:01
下一篇 2025年7月4日 下午9:43


相关推荐

  • 不招女人喜欢的男人15个细节

    不招女人喜欢的男人15个细节我喜欢成熟型的,我喜欢阳光型的,我喜欢温柔体贴的,身边的朋友诉说着自己的择偶要求,对于将来的另一半,总是充满着幻想,充满着期待,可是很多细节问题,女的很注意,哪怕,另一半属于这个类型,因为细节问题,也不会选择他作为,托付终身的选择。一:啰嗦一天到晚,听着他唠叨,把一件事情,从早晨念到晚上,虽然知道他是为自己好,可是不能忍受,自己的老公那么鸡婆,和一个女的一样…

    2022年7月25日
    14
  • Java进阶之reflection(反射机制)——反射概念与基础

    Java进阶之reflection(反射机制)——反射概念与基础这里写链接内容 反射机制是 Java 动态性之一 而说到动态性首先得了解动态语言 那么何为动态语言 一 动态语言动态语言 是指程序在运行时可以改变其结构 新的函数可以引进 已有的函数可以被删除等结构上的变化 比如常见的 JavaScript 就是动态语言 除此之外 Ruby Python 等也属于动态语言 而 C C 则不属于动态语言 二 Java 是动态语言吗 从动态语言能在运行时改变程序结构结构或则变量类型

    2026年3月17日
    1
  • photoshop合并图层:向下合并、合并选中层、合并可见图层、拼合图像操作

    photoshop合并图层:向下合并、合并选中层、合并可见图层、拼合图像操作我们在 photoshop 教程中如何合并图层呢 photoshop 合并图层分多种情况 分别是合并可见图层 向下合并 合并选中层 拼合图像 下面我们逐一介绍 ps 怎样合并图层 photoshop 如何合并图层 向下合并 向下合并图层的的意思是 当前图层和下面的一个图层合并 需要注意的是进行合并的层都必须处在显示状态 不能隐藏 否则向下合并命令不可用 我们可以多次执行 向下合并 来合并图层

    2026年3月17日
    2
  • css增加横着滚动条_CSS 设置滚动条样式的实现「建议收藏」

    webkit滚动条样式重置1、scrollbar包含scrollbarbuttons和一个track。track进一步细分为trackpieces和thumb。tracepieces为thumb的上半部分和半下部分。2、scrollbarcorner为横向和竖向的交叉角区域3、resize用来设置滚动条的交汇处上用于拖动调整元素大小的小控件组成结构图如下:一旦发现滚动条的自定义样式,浏览器…

    2022年4月8日
    704
  • JS获取当前时间(精确到秒)「建议收藏」

    JS获取当前时间(精确到秒)「建议收藏」js获取当前日期currentDate(){vard=newDate();varyear=d.getFullYear();varmonth=d.getMonth();month=month+1>12?1:month+1;month=month>9?month:”0″+month.toString();var

    2026年2月20日
    4
  • 解决:为什么VMware虚拟机配置连上网了,电脑重启后,联网需要重置?!看这里

    解决:为什么VMware虚拟机配置连上网了,电脑重启后,联网需要重置?!看这里

    2021年5月28日
    191

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号