无法建立 TCP 连接,RabbitMQ

Can't establish TCP connection, RabbitMQ

我是 RabbitMQ 的新手,我想 运行 使用以下命令在 centOS7 上创建一个 RabbitMQ 服务器实例:

sudo systemctl start rabbitmq-server

该命令似乎要花很长时间,当我停止进程并检查日志文件时,一切正常,它说 rabbit 已启动并且 运行ning。但是当我尝试使用 rabbitmqctl 执行任何命令时,出现以下错误:

Error: unable to perform an operation on node 'rabbit@hostname'. 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@hostname
 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

**DIAGNOSTICS**
attempted to contact: [rabbit@hostname]

rabbit@hostname:
  * connected to epmd (port 4369) on hostname
  * 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 'hostname' resolves, is reachable and ports 25672, 4369 are not blocked by firewall

Current node details:
 * node name: 'rabbitmqcli-806330-rabbit@hostname'
 * effective user's home directory: /var/lib/rabbitmq
 * Erlang cookie hash: KgAE7WR3dl5/FGAyWKE5LA==

我尝试手动终止进程,但没有成功。 每个需要的端口都在监听,我可以远程登录它们。你能帮我看看问题出在哪里吗?

客户端机器无法解析指向 rabbitmq 服务器的主机名。

如果 IP 地址未公开传播,您必须将 IP/host 组合放入 /etc/hosts 文件。

您也可以尝试连接到 IP 地址而不是主机名以清除任何其他与网络相关的问题。