rabbitmq refusing to start

Rabbitmq

Rabbitmq Problem Overview


I have installed rabbitmq on ubuntu and trying to start it using rabbitmq-server start, however, I'm getting this error:

Activating RabbitMQ plugins ...

0 plugins activated:

node with name "rabbit" already running on "mybox"

diagnostics:

- nodes and their ports on mybox: [{rabbit,38618},
                                       {rabbitmqprelaunch13346,41776}]
- current node: rabbitmqprelaunch13346@mybox
- current node home dir: /var/lib/rabbitmq
- current node cookie hash: 8QRKGluOJOcZ4AAkEdFwQg==

so I try to stop it or restart it using service rabbitmq-server restart but I get the following error: Restarting rabbitmq-server: RabbitMQ is not running

The server's host name hostname -s is mybox.

How do I stop the currently running instance, or at least, how do I manage it? I have no access to it and yet I'm not able to run rabbitmq properly.

Thank you.

Rabbitmq Solutions


Solution 1 - Rabbitmq

Rabbitmq is set to start automatically after it's installed. I don't think it is configured run with the service command.

To see the status of rabbitmq

sudo rabbitmqctl status

To stop the rabbitmq

sudo rabbitmqctl stop

(Try the status command again to see that it's stopped). To start it again, the recommended method is

sudo invoke-rc.d rabbitmq-server start

These all work with the vanilla ubuntu install using apt-get

Still not working?

If you've tried unsuccessfully to start or restart rabbitmq, check to see how many processes are running.

ps -ef | grep rabbit

There should be 5 processes running as the user rabbitmq. If you have more, particularly if they're running as other users (such as root, or your own user) you should stop these processes.

The cleanest way is probably to reboot your machine.

Solution 2 - Rabbitmq

rabbitmq-server refuses to start if the hostname -s value has changed.

The solution suggested here is only for test/development environments.

I had to delete the database to fix it locally. i.e empty folder /var/lib/rabbitmq (ubuntu) or /usr/local/var/lib/rabbitmq/(mac)

Solution 3 - Rabbitmq

I had similar problem but these suggestions didn't work for me(restart too). When I run rabbitmq-server command, I get a response like that:

$/ rabbitmq-server


BOOT FAILED
===========

Error description:
   {error,{cannot_log_to_file,"/var/log/rabbitmq/[email protected]",
                              {error,eacces}}}
....

When I checked permissions of /var/log/rabbitmq/[email protected] file, I saw that group has not write permisson for that file. So I gave permission to group with that command:

/var/log/rabbigmq/$ chmod g+w *

then problem has gone!

Maybe this answer help someone.

Solution 4 - Rabbitmq

Seems like the Mnesia database was corrupted. Had to delete it to get sudo service rabbitmq-server start going again !

> $ sudo rm -rf /var/lib/rabbitmq/mnesia/

Also make sure that any stray rabbit processes are killed before clearing out

> $ ps auxww | grep rabbit | awk '{print $2}' | sudo xargs kill -9

And then > $ sudo service rabbitmq-server start

Solution 5 - Rabbitmq

If you use celery, your queues could reach max size and rabbit won't start because of that. Maybe you wouldn't even able to use rabbitmqctl, so if you can afford to clean the queues, just remove

/var/lib/rabbitmq/mnesia/rabbit@<host>/queues

on unix (look for mnesia DB path on your system). Be careful: this will remove everything you have in rabbit, so this is a last solution ever.

Solution 6 - Rabbitmq

Have a look what is in the log of the node that you are trying to start. It will be in /var/log/rabbitmq/ It was selinux in my case, rabbit could not bind to its ports.

Solution 7 - Rabbitmq

If the standard stop and start are not working, list the rabbitmq processes that are running using

ps aux | grep rabbitmq

Kill the beam.smp process using

kill -9 {process id} 

and start the rabbitmq-server again.

Solution 8 - Rabbitmq

My brew version of rabbitmq refused to start (after working fine for years without modification by me) too.

$ cat /usr/local/etc/rabbitmq/rabbitmq-env.conf
CONFIG_FILE=/usr/local/etc/rabbitmq/rabbitmq
NODE_IP_ADDRESS=127.0.0.1
NODENAME=rabbit@localhost
RABBITMQ_LOG_BASE=/usr/local/var/log/rabbitmq

I edited out rabbit@ on NODENAME and brew services restart rabbitmq started working again.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAliView Question on Stackoverflow
Solution 1 - RabbitmqGregHNZView Answer on Stackoverflow
Solution 2 - RabbitmqVenkat KotraView Answer on Stackoverflow
Solution 3 - RabbitmqMurat ÇorluView Answer on Stackoverflow
Solution 4 - RabbitmqShankar ARULView Answer on Stackoverflow
Solution 5 - RabbitmqThorin SchifferView Answer on Stackoverflow
Solution 6 - RabbitmqTomasz SwiderView Answer on Stackoverflow
Solution 7 - RabbitmqVineet NairView Answer on Stackoverflow
Solution 8 - RabbitmqnezdaView Answer on Stackoverflow