RabbitMQ: Change the Hostname

rabbitmq-change-hostname

WARNING: ALL THE RABBITMQ DATA WILL BE LOST WITH THIS OPERATION. Please backup your rabbitmq database before doing this (check the documentation about).

If you change the name of the machine where RabbitMQ server is installed, you will see that the service will no longer be startable, this because RabbitMQ relays on the machine name to create and connect to the node, even if it is local.

To fix this problem, you just have to reinstall the rabbitmq windows service, by using the proper command line utility rabbitmq-service.bat

*********************
Service control usage
*********************

rabbitmq-service help    - Display this help
rabbitmq-service install - Install the RabbitMQ service
rabbitmq-service remove  - Remove the RabbitMQ service

The following actions can also be accomplished by using
Windows Services Management Console (services.msc):

rabbitmq-service start   - Start the RabbitMQ service
rabbitmq-service stop    - Stop the RabbitMQ service
rabbitmq-service disable - Disable the RabbitMQ service
rabbitmq-service enable  - Enable the RabbitMQ service
  1. First start a command prompt as administrator and go to the rabbitmq-server-x sbin folder
    cd %programfiles(x86)%\RabbitMQ Server\rabbitmq_server-3.3.2\sbin
  2. Uninstall the service
    rabbitmq-service.bat remove
  3. Install the service
    rabbitmq-service.bat install

This should recreate the service and configure it to start the node with the correct name.

If this doesn’t work you can follow the instruction on how to completely reset a rabbitmq server installation.

2 thoughts on “RabbitMQ: Change the Hostname”

  1. Fuck me. I had to wipe everything rabbitMQ. I knew removing all the components would reset it. I was even playing with the service but never thought of uninstalling and re-installing.

    Luckily this was on a dev machine.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: