I am using django-celery for my django project. Last day I have changed my computer\'s hostname (I am using Ubuntu 12.04, edited file \'/etc/hostname\'), and after next restart
Richard's answer is good, but you might lose some information in the rabbitmq queues. The following is a possible way to preserve the previous setup of rabbitmq with the new host name.
A Short Answer:
If you want to keep the new host name change, then you can create a rabbitmq-env.conf
files in /etc/rabbitmq
that references the old host name and all should be good. The following is what should be in the rabbitmq-env.conf
file:
NODENAME=rabbit@OLDHOSTNAME
After adding the config file, restart the rabbitmq server then you should be good. (e.g. service rabbitmq-server restart
(might need a sudo
with ubuntu))
For more details you can read from the rabbitmq website: https://www.rabbitmq.com/man/rabbitmq-env.conf.5.man.html
More Details About the Answer:
I had a similar hostname issues using CentOS... The root issue was when rabbit installs, it references the current host name at the time of install. Since this is a rabbitmq thing, the solution should work for other linux flavors. If you want to see the full answer, you can see it at: rabbtimqadmin - Could not connect: [Errno -2] Name or service not known