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

7
我按照这个指南 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脚本。


作为云环境,它的配置可能与全新安装不同,请参考此帖子:https://dev59.com/jn7aa4cB1Zd3GeqPusYa。顺便说一句,坚持下去,Linux 是开发/生产的首选... ;) - Richard Dunn
2个回答

5

我通过在文件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

/etc/hostname 中的主机名(76672.localhost)可能无法解析为 IP 地址。在 /etc/hosts 中没有提到它(只有 76672.local)。Erlang 要求主机名能够被解析为某个东西。 - Jean-Sébastien Pédron

0

如果它只在本地主机设置下工作,请查看以下内容:

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接