0
0
RabbitmqDebug / FixBeginner · 4 min read

How to Fix Disk Alarm in RabbitMQ Quickly

To fix a disk alarm in RabbitMQ, free up disk space on the server or increase the disk free limit in RabbitMQ's configuration. You can also clear the alarm manually using rabbitmqctl once sufficient space is available.
🔍

Why This Happens

RabbitMQ triggers a disk alarm when the available disk space falls below a set threshold. This alarm stops message publishing to prevent data loss or corruption. The default threshold is usually 1 GB free space or 5% of disk space, whichever is smaller.

If your disk is nearly full, RabbitMQ will block producers and show a disk alarm error.

bash
rabbitmqctl status

# Output shows disk alarm active due to low disk space
Output
Status of node rabbit@hostname ... [{disk_free_limit,500000000}, {disk_free,300000000}] Disk alarm is active: free disk space below limit
🔧

The Fix

First, free up disk space on the server by deleting unnecessary files or expanding disk capacity. Then, you can clear the alarm manually with rabbitmqctl if space is sufficient.

Alternatively, adjust the disk free limit in the RabbitMQ configuration file rabbitmq.conf to a lower value if appropriate.

bash
sudo rabbitmqctl clear_disk_alarm

# To change disk free limit, add to rabbitmq.conf:
disk_free_limit.absolute = 500000000  # 500 MB

# Restart RabbitMQ after config change
sudo systemctl restart rabbitmq-server
Output
Disk alarm cleared # After restart, disk alarm no longer active if disk space is above new limit
🛡️

Prevention

Monitor disk space regularly to avoid hitting the disk alarm threshold. Use automated alerts for low disk space on RabbitMQ servers.

Set appropriate disk free limits in rabbitmq.conf based on your environment and disk size.

Consider using log rotation and cleaning up old data to keep disk usage low.

⚠️

Related Errors

Similar errors include memory alarms in RabbitMQ, which block operations when RAM usage is too high. Fix these by freeing memory or adjusting memory limits.

Network partition alarms can also occur, requiring network troubleshooting.

Key Takeaways

Free disk space immediately to clear RabbitMQ disk alarms.
Use 'rabbitmqctl clear_disk_alarm' after freeing space to reset the alarm.
Adjust disk_free_limit in rabbitmq.conf to fit your environment.
Monitor disk usage regularly to prevent alarms.
Related alarms include memory and network partition alarms.