RabbitMQ lost user info

How to fix rabbit lost user info after a reboot?

RabbitMQ

lost user info

After rebooting, the rabbit user info lost.

Cause

Because RabbitMQ stores info by hostname.

Hostname had been changed, so RabbitMQ getting info by the new hostname failed

Solution

To add fixed node

1
2
3
4
5
6
7
echo 'NODENAME=rabbit@info' | sudo tee -a /etc/rabbitmq/rabbitmq-env.conf

echo '127.0.0.1 info' | sudo tee -a /etc/hosts

ps axu | grep rabbitmq | awk '{print $2}' | sudo xargs kill -9

sudo service rabbitmq-server start