RabbitMQ database files

谁都会走 提交于 2019-12-25 02:22:53

问题


I'm running RabbitMQ V.2.0.0. on a Linux machine. The mnesia base is current the default, but the within that directory Rabbit creates directories, eg. rabbit@ip-123.1.1.123.

The ip in the directory name is based on the inet addr of the machine. This directories hold information about user, exchanges, vhost (I think).

My question is, how can I fix/config these directory names with ip to be not based on ip?


回答1:


To change the Mnesia directory, just set MNESIA_DIR in /etc/rabbitmq/rabbitmq.conf.

Also, a great place to ask RabbitMQ related questions is on the rabbitmq-discuss mailing list.




回答2:


It seems you can edit the scripts files (rabbitmq-server, rabbitmq-mulit and rabbitmqcti). In these scripts at the top is a hostname variable.

I set the hostname to localhost and restarted.

This is not the best, but good enough for my requirements. The hostname must be a proper address, it cannot be something arbitrary.




回答3:


The main problem is that your new machine has new hostname - and directory is named after it (just renaming directory as mentioned before, does not help) so we need to rename your machine hostname and make RabbitMq to work with old files. Let "ip-0-0-0-0" be old machine name (so there should be a mnesia folder /var/lib/rabbitmq/mnsesia/ip-0-0-0-0), and new machine host name is something like "ip-1-1-1-1", but new name doesnot matter as we will overwrite it. Execute following commands:

sudo -s
echo "127.0.0.1 ip-0-0-0-0" >> /etc/hosts 
echo "ip-0-0-0-0" > /etc/hostname
reboot

After reboot your machine will have a new name and RabbitMq should work with old files.



来源:https://stackoverflow.com/questions/3889227/rabbitmq-database-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!