What to do when RabbitMQ fails to restart
Occasionally, RabbitMQ fails to restart. This can be an important issue in case the broker contains persistent data; otherwise, it's enough to reset the broker persistent state.
Getting ready
To run this recipe, you just need a test RabbitMQ broker.
Note
We are going to destroy all the previously defined data—avoid using a production instance.
How to do it...
To clean-up RabbitMQ, it's enough to follow these simple steps:
- Stop RabbitMQ if it is running.
- Locate the Mnesia database directory. By default, it's
/var/lib/rabbitmq/mnesia
(Linux) or%APPDATA%\RabbitMQ\db
(Windows). - Delete it recursively.
- Restart RabbitMQ.
How it works...
The Mnesia database contains all the runtime definitions of RabbitMQ: queues, exchanges, ...
Get RabbitMQ Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.