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

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

问题描述

我在CentOS 5.x服务器上安装了RabbitMQ,用于在程序之间传递消息.我已经按照 https://www.rabbitmq.com/management上的指示安装了rabbitmqadmin -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/man/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天全站免登陆