You installed RabbitMQ successfully via homebrew and later you needed to make use of it. Ran brew services list
and discovered that RabbitMQ was no longer running because it had stopped
. You run brew services start RabbitMQ
to bring it back up and you see a log saying:
==> Successfully started `rabbitmq` (label: homebrew.mxcl.rabbitmq)
But when you check brew services list
again you see that it didn't start at all or started and stopped almost immediately.
Here is how I fixed it:
1.) brew services stop rabbitmq
to stop RabbitMQ.
2.) brew uninstall rabbitmq
to uninstall RabbitMQ but after running this there might be some leftover folders that were not deleted while uninstalling RabbitMQ. This will be fixed in step 3.
3.) Run find / -type d -name "rabbitmq" -print 2>/dev/null
. This will show us paths that have stale RabbitMQ data. The result can look something like this:
/usr/local/etc/rabbitmq
/usr/local/var/lib/rabbitmq
/usr/local/var/log/rabbitmq
...
Which is the first three lines of the command and the most important part we need from the command. Note that the command may take some time(like 10 minutes) to run to completion.
4.) Remove the folders found in the paths above (etc, lib, log) by running the commands below:
rm -rf /usr/local/etc/rabbitmq
rm -rf /usr/local/var/lib/rabbitmq
rm -rf /usr/local/var/log/rabbitmq
The commands will remove those leftover folders from RabbitMQ as they may hold data from previously installed RabbitMQ which may not allow the RabbitMQ that will be installed in step 6 to work properly.
5.) Next, update homebrew by running brew update
and if any error as fatal: couldn't find remote ref refs/heads/master
is encountered, running brew tap --repair
should fix the problem.
6.) Install RabbitMQ by running brew install rabbitmq
.
7.) Lastly, start RabbitMQ by running brew services start rabbitmq
.
8.) Run brew services list
and RabbitMQ should be started now(green).
rabbitmq started <user> ~/Library/LaunchAgents/homebrew.mxcl.rabbitmq.plist
You may choose to run this command over and over again to be sure RabbitMQ is up like I did.
In fact, another way to confirm it's working is you can (like I also did) visit RabbitMQ localhost and login using guest
as both email and password to interact with the RabbitMQ GUI.
If step 7 throws an error, you can do brew services restart rabbitmq
.
Note that these are the exact steps I took to fix the errors I had(on MacOS Intel Corei7 Ventura 13.5.1) and this might differ for others.
Top comments (0)