rabbitmq-server无法启动 - 无法连接到epmd / Ubuntu 16.04

时间:2017-07-31 21:05:59

标签: rabbitmq ubuntu-16.04

我按照本指南https://www.rabbitmq.com/install-debian.html安装了rabbitmq-server。但是,它不会以错误消息开头:

Jul 31 20:29:49 76672.local rabbitmqctl[7519]: attempted to contact: [rabbit@76672]
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: rabbit@76672:
Jul 31 20:29:49 76672.local rabbitmqctl[7519]:   * unable to connect to epmd (port 4369) on 76672: badarg (unknown POSIX error)
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: current node details:
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: - node name: 'rabbitmq-cli-30@76672'
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: - home dir: /var/lib/rabbitmq
Jul 31 20:29:49 76672.local rabbitmqctl[7519]: - cookie hash: VwJCJ/LkSvmUKaoPOglCcQ==
Jul 31 20:29:49 76672.local systemd[1]: Failed to start RabbitMQ broker.
Jul 31 20:29:49 76672.local systemd[1]: rabbitmq-server.service: Unit entered failed state.
Jul 31 20:29:49 76672.local systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
dpkg: error processing package rabbitmq-server (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 rabbitmq-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
altor_work@76672:

我试图在一个明确的Ubuntu实例上进行此安装并得到相同的错误。我用谷歌搜索了错误信息,似乎我的网络设置有问题 - 我想我应该从默认状态更改一些设置。

知道需要改变什么吗?或者我应该首先尝试哪种设置?

P.S。我是Unix的新手。对我来说,这只是一个我运行Python脚本的云环境。

2 个答案:

答案 0 :(得分:3)

我通过在文件rabbitmq-env.conf中设置HOSTNAME来解决我的问题。我不知道究竟是什么原因引起了这个问题。

我的设置:

sudo cat /etc/hostname
76672.localhost

sudo cat /etc/hosts
127.0.0.1   localhost
127.0.1.1   ubuntu16.04 ubuntu16
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1 76672.local

/etc/rabbitmq/rabbitmq-env.conf
# Empty - if the file is empty rabbitmq doesn't start
HOSTNAME=76672.local # With this rabbitmq doesn't start either
HOSTNAME=localhost # With this all works

答案 1 :(得分:0)

如果仅适用于 localhost 设置,请查看以下内容:

fgrep BindToDevice /lib/systemd/system/epmd.socket