由于 rabbitmq 导致尝试重新安装 postgres 失败

由于 rabbitmq 导致尝试重新安装 postgres 失败

在 12.04 上,当我apt-get install在 postgresql(已安装)上执行操作时,它会返回一个提及 rabbitmq-server 的错误。哪些情况可能导致此类故障?

# apt-get install -y postgresql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
postgresql is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 80 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up rabbitmq-server (2.7.1-0ubuntu4) ...
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)

答案1

事实证明,rabbitmq-server 无法启动,因为它无法解析主机名,因此在 /etc/hosts 中添加适当的行可以解决问题:

127.0.1.1 hostname.example.com hostname

我仍然不完全确定在 postgres 安装后是什么触发了 rabbit service start 命令。

答案2

为确保万无一失,请查看您的本地网络

ip add

如果没有lo网络,则应该启用它:

ifconfig lo up

然后再次重新启动服务器,看看它现在是否再次工作

systemctl start rabbitmq-server

相关内容