RabbitMQ failed install/start on Debian Stretch
Asked Answered
T

2

4

Following a

sudo apt-get install rabbitmq-server

I'm hitting errors when the service attempts to start (also when using systemctl start):

● rabbitmq-server.service - RabbitMQ Messaging Server
  Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
  Active: failed (Result: exit-code) since Wed 2017-07-26 15:59:41 IDT; 4min 28s ago
  Process: 17895 ExecStartPost=/usr/lib/rabbitmq/bin/rabbitmq-server-wait (code=exited, status=70)
  Process: 17894 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=1/FAILURE)
 Main PID: 17894 (code=exited, status=1/FAILURE)

That's in systemctl status. In journalctl -xe:

-- Unit rabbitmq-server.service has begun starting up.
Jul 26 15:59:37 myhost rabbitmq[17895]: Waiting for rabbit@myhost ...
Jul 26 15:59:37 myhost rabbitmq[17895]: pid is 17903 ...
Jul 26 15:59:40 myhost systemd[1]: rabbitmq-server.service: Main process exited, code=exited, status=1/FAILURE
Jul 26 15:59:41 myhost rabbitmq[17895]: Error: process_not_running
Jul 26 15:59:41 myhost systemd[1]: rabbitmq-server.service: Control process exited, code=exited status=70
Jul 26 15:59:41 myhost systemd[1]: Failed to start RabbitMQ Messaging Server.
-- Subject: Unit rabbitmq-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit rabbitmq-server.service has failed.
-- 
-- The result is failed.
Jul 26 15:59:41 myhost systemd[1]: rabbitmq-server.service: Unit entered failed state.
Jul 26 15:59:41 myhost systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
Tonguetied answered 26/7, 2017 at 13:12 Comment(3)
Hi! Could you please post the RabbitMQ log files, located in /var/log/rabbitmq?Hasseman
@Jean-SébastienPédron Sorry, I got it working so they don't show any error now. I didn't know about them so the comment should be helpful for other people looking here.Tonguetied
Ok, great that you solved it :)Hasseman
T
10

OK, this was a rough one:

  1. Make sure your hostname is correct. you can run

    sudo hostname --file /etc/hostname

    to make sure. If it isn't change it by changing /etc/hostname. a.b.c.d should be enough.

  2. If you're behind a company firewall rabbitmq will fail to connect to all the interfaces. Change /etc/rabbitmq/rabbitmq-env.conf, setting NODE=rabbit@localhost. This is enough for development.

Now you can sudo apt-get install --fix-broken to complete the installation (will complain it was scheduled for more stuff). Use sudo rabbitmqctl status to make sure the node is properly running - it will say it clearly if not.

Tonguetied answered 26/7, 2017 at 13:52 Comment(2)
Beautiful, this worked for me after several hours of searching. To further clarify for anyone else arriving here, hostname displays the hostname but calling hostname --file /etc/hostname will set the hostname to whatever is in the --file arg.Cousingerman
Note /etc/hostname is the usual file on many Linux flavors your hostname is saved. If someone thinks, it's a different file, please don't edit it in replace of this name, instead, add it along side with the flavor of Linux it is relevant to.Tonguetied
U
0

You should check log files at /var/log/rabbitmq/ location

See if there is more information about why it fails. Most error details are available in the file named rabbit@<host_name>.log

Also, check /etc/rabbitmq/enabled_plugins permissions and grant permissions if needed.

Unsustainable answered 7/6 at 17:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.