rabbtimqadmin - 无法连接:[Errno -2] 名称或服务未知 [英] rabbtimqadmin - Could not connect: [Errno -2] Name or service not known

查看:10
本文介绍了rabbtimqadmin - 无法连接:[Errno -2] 名称或服务未知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 CentOS 5.x 服务器上安装了 RabbitMQ,用于在我的程序之间传递消息.我已经按照 https://www 上的说明安装了 rabbitmqadmin.rabbitmq.com/management-cli.html 并且过去曾在我的服务器上使用过它.

I have RabbitMQ installed on a CentOS 5.x server which I use for message passing between my programs. I've installed rabbitmqadmin following the directions on https://www.rabbitmq.com/management-cli.html and have used it on my servers in the past.

据我所知,这个特定的服务器似乎配置错​​误.我的网络搜索未能让我尝试获取有关如何解决此问题的更多信息.

From what I can tell it looks like this particular server is misconfigured. My web-searches have failed me on trying to get more information on how to troubleshoot this issue.

错误:

[root@server ~]# python26 /usr/local/bin/rabbitmqadmin list nodes
*** Could not connect: [Errno -2] Name or service not known
[root@server ~]# 

我尝试了几个不同的 rabbitmqadmin 命令,它们给出了相同的结果.如果我在没有额外参数的情况下运行命令,它会显示正常的帮助对话框.我有这个设置并在其他几台服务器上工作.

I have tried several different rabbitmqadmin commands and they give the same result. If I run the command without the extra params it displays the normal help dialog. I have this setup and working on several other servers.

知道根本问题是什么吗?如果没有,无论如何要获取更多详细信息,例如详细信息?

Any idea on what the root issue is? If not, anyway to get more details, like verbose?

更新:

我只是尝试检查 rabbitmq 的版本,它也产生了错误:

I just tried to check the version of rabbitmq and its yielding an error too:

[root@server ~]# rabbitmqctl status
Status of node rabbit@server ...
Error: unable to connect to node rabbit@server: nodedown

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

attempted to contact: [rabbit@server]

rabbit@server:
  * connected to epmd (port 4369) on server
  * epmd reports node 'rabbit' running on port 25672
  * TCP connection succeeded but Erlang distribution failed
  * suggestion: hostname mismatch?
  * suggestion: is the cookie set correctly?

current node details:
- node name: rabbitmqctl25451@server
- home dir: /var/lib/rabbitmq
- cookie hash: WXaeZT7XXm13naagfRX5cg==

[root@server ~]# 

我要看看能否从中找到一些东西...我觉得这很奇怪,因为服务器可以正常传递消息并且可以通过 Web 控制台进行监控.

I'm going to see if I can find something from this... I find this weird because the server is passing messages fine and can be monitored through the web console.

Erlang 版本:

[root@server rabbitmq]#  erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().'  -noshell
"R14B04"
[root@server rabbitmq]# 

Rabbitmq 版本:

[root@server rabbitmq]# python26 /usr/local/bin/rabbitmqadmin --version
rabbitmqadmin 3.3.5
[root@server rabbitmq]# 

推荐答案

经过多次挖掘和挫折,我发现了我的问题......我发布解决方案以防其他人有类似的经历

After much digging and frustration, I found my problem... I'm posting the solution in case anyone else has a similar experience

以前,我发现如果您在 linux 服务器上设置 RabbitMQ,然后更改主机名,它可能会破坏一些 rabbit 配置.

Previously, I found that if you setup RabbitMQ on a linux server then change the hostname that it can break some of the rabbit configuration.

关于这个问题的令人敬畏的部分是有人将服务器的名称从所有大写字母更改为小写...

The awesome part about this problem is that someone changed the name of the server from all capital letters to lowercase...

我已经解决了以下两种方法之一:

I've solve this one of two ways:

解决方案 1:

将主机名恢复为以前的名称.因此,带有附加服务器名称的 rabbitmq 引用再次起作用.

Revert the host name back to the previous name. So that rabbitmq references with the appended server name work again.

解决方案 2:

如果你想保持服务器名称的变化,那么你可以在 /etc/rabbitmq 中创建一个 rabbitmq-env.conf 文件,例如:

If you want to keep the server name change, then you can create a rabbitmq-env.conf files in /etc/rabbitmq like:

NODENAME=rabbit@OLDHOSTNAME

如果你不确定你以前的名字是什么,你可以通过在 /var/lib/rabbitmq/mnesia/ 文件夹中执行 ls 来引用它.然后,您将看到一个与您需要指定的节点名匹配的文件夹.

If you aren't sure what your previous name was, you can reference it by doing an ls in your /var/lib/rabbitmq/mnesia/ folder. You'll then see a folder that matches the nodename you need to specify.

参考:https://www.rabbitmq.com/人/rabbitmq-env.conf.5.man.html

更新:

主机名是 CaSE SenSiTIve...有人更改了我的主机名,唯一的区别是这种情况...所以花了一段时间才注意到...

Host name is CaSE SeNSiTIve... had someone change a hostname on me and the only difference was the case... so took a while to notice...

这篇关于rabbtimqadmin - 无法连接:[Errno -2] 名称或服务未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆