rabbitmq 高可用集群部署踩坑

大家好,我是早九晚十二,目前是做运维相关的工作。写博客是为了积累,希望大家一起进步!
我的主页:早九晚十二在这里插入图片描述

问题描述

今天在搭建rabbitmq集群时使用rabbitmqctl status碰到如下问题:

Status of node rabbit@iZwz9cxht3eh2v5xk5yqx4Z ...
Error: unable to perform an operation on node 'rabbit@iZwz9cxht3eh2v5xk5yqx4Z'. 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@iZwz9cxht3eh2v5xk5yqx4Z

DIAGNOSTICS
===========

attempted to contact: [rabbit@iZwz9cxht3eh2v5xk5yqx4Z]

rabbit@iZwz9cxht3eh2v5xk5yqx4Z:
  * unable to connect to epmd (port 4369) on iZwz9cxht3eh2v5xk5yqx4Z: nxdomain (non-existing domain)


Current node details:
 * node name: 'rabbitmqcli-10319-rabbit@iZwz9cxht3eh2v5xk5yqx4Z'
 * effective user's home directory: /var/lib/rabbitmq
 * Erlang cookie hash: 48iUfALoSn26msGydd+V/g==

问题分析

主要看错误提示信息

  • 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

我们可以根据上面错误依次排查

提示一:*无法访问目标节点(例如,由于主机名解析、TCP连接或防火墙问题)

#查看firewall状态
firewall-cmd --state
#查看iptable策略
iptables -nL

提示二:*CLI工具无法与服务器进行身份验证(例如,由于CLI工具的Erlang cookie与服务器的Erlang cookie不匹配)

查看/var/lib/rabbitmq/.erlang.cookie文件md5是否与其他的cookie一致,一般windows会有多个.erlang.cookie文件,只需要将其中一个复制过去即可

提示三:*目标节点未运行

#查看rabbitmq是否为running状态
systemctl status rabbitmq-server

如果上述提示无法解决问题,那么再继续往下看

rabbit@iZwz9cxht3eh2v5xk5yqx4Z: * unable to connect to epmd (port
4369) on iZwz9cxht3eh2v5xk5yqx4Z: nxdomain (non-existing domain)

提示四:*无法连接到iZwz9cxht3eh2v5xk5yqx4Z上的epmd(端口4369)

该提示是表示无法解析到主机名(我本人的是这个问题),需要修改配置文件rabbitmq1为自己的主机名,然后重启。

[root@iZwz9cxht3eh2v5xk5yqx4Z rabbitmq-server-3.7.9]# cat /etc/rabbitmq/rabbitmq-env.conf 
RABBITMQ_NODENAME=rabbit@rabbitmq1

码字不易,希望大家有用到的可以三连支持一波。哪里有问题的话可以指出,谢谢大家!
在这里插入图片描述

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

早九晚十二

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值