RabbitMQ 在启动时似乎崩溃

RabbitMQ 在启动时似乎崩溃

如何诊断 Ubuntu 16 上的 RabbitMQ 崩溃问题?

当我运行sudo service rabbitmq-server status它时会报告:

● rabbitmq-server.service - RabbitMQ Messaging Server
   Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Wed 2018-03-21 19:44:18 UTC; 19min ago
  Process: 1100 ExecStartPost=/usr/lib/rabbitmq/bin/rabbitmq-server-wait (code=killed, signal=TERM)
  Process: 1099 ExecStart=/usr/sbin/rabbitmq-server (code=killed, signal=TERM)
 Main PID: 1099 (code=killed, signal=TERM)

意味着它崩溃了或者无法启动。但是,当我运行 htop 时,我看到了几十个 erlang 和beam.smp进程,它们是由 Rabbit 启动的。

此外,当我重新启动 Rabbit 时,sudo service rabbitmq-server restart它会挂起大约五分钟,然后最后返回:

Job for rabbitmq-server.service failed because a timeout was exceeded. See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.

当我跑步时,journalctl -xe我会看到大量类似的消息:

Mar 21 20:07:48 server1 postfix/error[3719]: 280524B3A: to=<[email protected]>, orig_to=<root>, relay=none, delay=101268, delays=101268/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspende
Mar 21 20:07:48 server1 postfix/qmgr[1784]: 2D046FAC: from=<>, size=3126, nrcpt=1 (queue active)
Mar 21 20:07:48 server1 postfix/qmgr[1784]: 2D8AD474F: from=<[email protected]>, size=751, nrcpt=1 (queue active)
Mar 21 20:07:48 server1 postfix/error[3712]: 2ED9D499A: to=<[email protected]>, orig_to=<root>, relay=none, delay=155868, delays=155868/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspende
Mar 21 20:07:48 server1 postfix/qmgr[1784]: 2EBCF3D40: from=<>, size=3128, nrcpt=1 (queue active)
Mar 21 20:07:48 server1 postfix/error[3706]: 2D8AD474F: to=<[email protected]>, orig_to=<root>, relay=none, delay=38268, delays=38268/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended:
Mar 21 20:07:48 server1 postfix/error[3716]: 2D046FAC: to=<[email protected]>, relay=none, delay=76240, delays=76240/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to porta
Mar 21 20:07:48 server1 postfix/qmgr[1784]: 2C9DE3945: from=<>, size=3134, nrcpt=1 (queue active)
Mar 21 20:07:48 server1 postfix/qmgr[1784]: 2AA2A48B3: from=<[email protected]>, size=751, nrcpt=1 (queue active)
Mar 21 20:07:48 server1 postfix/error[3717]: 2C9DE3945: to=<[email protected]>, relay=none, delay=399644, delays=399644/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to po
Mar 21 20:07:48 server1 postfix/error[3701]: 2EBCF3D40: to=<[email protected]>, relay=none, delay=181242, delays=181242/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to po
Mar 21 20:07:48 server1 postfix/error[3712]: 2AA2A48B3: to=<[email protected]>, orig_to=<root>, relay=none, delay=59268, delays=59268/0/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended:

我是否正确地得出结论:Rabbit 正在尝试发送大量电子邮件,但遭到阻止,随后崩溃?这是为什么?

答案1

我修复了它:

sudo killall rabbitmq-server
sudo killall beam.smp
sudo rm -Rf /var/lib/rabbitmq/mnesia/*
sudo service rabbitmq-server start

我还必须重新添加我的用户配置,但除此之外,它还会恢复正常。

答案2

这看起来不像是“崩溃”……而是由于问题而正常关闭。显然,服务超时了。我认为这是因为它无法连接到远程消息服务器。您发布的“电子邮件”表明它试图发送失败的电子邮件通知……这可能也意味着 Postfix 邮件服务器未配置为在框外中继消息。

相关内容