在Ubuntu 10.10上安装rabbitMQ服务器时出错

当我通过以下命令在突触安装rabbitMQ

sudo apt-get install rabbitmq-server 

它返回一个错误:

 Starting rabbitmq-server: FAILED - check /var/log/rabbitmq/startup_log, _err rabbitmq-server. invoke-rc.d: initscript rabbitmq-server, action "start" failed. dpkg: error processing rabbitmq-server (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: rabbitmq-server E: Sub-process /usr/bin/dpkg returned an error code (1) 

去日志,它说:

 Error: {cannot_connect_to_epmd,"herman-desktop",address} 

而我的/etc/hosts定义如下:

 127.0.0.1 localhost.localdomain localhost ::1 herman-desktop localhost6.localdomain6 localhost6 127.0.1.1 herman-desktop 

我需要做什么来解决这个问题?

您只有在/ etc / hosts中configuration的“herman-desktop”才能在ipv6中configuration为localhost地址,因为rabbitmq正在运行ipv4,因此无法连接,编辑/ etc / hosts并添加herman-desktop(您的计算机名称我想)到127.0.0.1(ipv4上的本地主机)

另外,除非你在你的机器上configuration了127.0.1.1它看起来像一个types:)

最好的办法是告诉rabbitmq不要查找主机名。 你可以使用rabbitmqconfiguration文件来做到这一点。

编辑configuration,创build它,如果它不存在

 vim /etc/rabbitmq/rabbitmq.conf vim /etc/rabbitmq/rabbitmq-env.conf (in later versions of RabbitMQ) 

添加以下条目:

 NODENAME=rabbit@localhost NODE_IP_ADDRESS=127.0.0.1 

当我在安装厨师服务器时更改主机名时,发生了这种情况。 我恢复了旧的主机名,杀死了正在运行的rabbitmq进程,清除了rabbitmq包,然后重新运行了chef-server的chef-solo bootstrap。