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(队列会被清空),请谨慎操作

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

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

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • 对 flask 的 jsonify 方法的理解

    对 flask 的 jsonify 方法的理解flask下面有个jsonify函数,函数的作用就是返回一个JSON类型的Response(一般用于把数据返回给前端)要使用jsonify,首先你得要按下面一样引用一下:`fromflaskimportjsonify,render_template,redirect,request,url_for其实这个方法就是JSON方法的再封装,简化了一下几步操作:jsonify返回的…

  • SQL查询–约束「建议收藏」

    SQL查询–约束「建议收藏」在慕课网上学习时记的关于oracle中约束概念的基础笔记,当初一直对约束的概念不清不楚的,所以找了些资料来看约束是数据库用来确保数据满足业务规则的手段约束的作用:定义规则、确保完整性1.非空约束

  • MySQL JDBC URL各参数详解

    MySQL JDBC URL各参数详解参数名称参数说明缺省值最低版本要求user数据库用户名(用于连接数据库)password用户密码(用于连接数据库)useUnicode是否使用Unicode字符集,如果参数characterEncoding设置为gb2312或gbk,本参数值必须设置为truefalse1.1guseSSLMySQL在高版本需要指明是否进行SSL连接在mysql连接字符串url中加入ssl=true或者false即可characterEncoding…

  • windows ftp 被动模式_通常ftp用主动还是被动模式

    windows ftp 被动模式_通常ftp用主动还是被动模式环境:windowsserver2012R2FTPclientFileZilla3.7.3windowsserver2012服务器搭建完毕后默认为主动式(测试发现windows10搭建完毕默认为被动式)由于开发人员所做视频推流不支持主动式故需要更改为被动式主动式:有客户端N端口发起连接到服务器端21端口传输数据时由服务器端20端…

  • B 站上有哪些很好的学习资源?[通俗易懂]

    B 站上有哪些很好的学习资源?[通俗易懂]哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!!最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇдˇ◕ฺ;)ノ下面我们就来盘点一下B站上优质的学习资源:综合类Oeasy:综合…

  • 使用PyCharm快速安装TensorFlow

    使用PyCharm快速安装TensorFlow本来之前写的《使用VirtualEnv在Mac安装TensorFlow》已经搭建好TensorFlow学习环境了,后来发现使用PyCharm搭建TensorFlow学习环境简直不要太方便了,就重新搭建了一遍!启动PyCharm,创建一个新项目,选择Newenvironmentusing->VirtualEnv,这样就是单独为新项目创建一个隔离的python环境。创建好新项目以后…

发表回复

您的电子邮箱地址不会被公开。

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