Making RabbitMQ independent of hostname of system

350 views
Skip to first unread message

badrira...@gmail.com

unread,
Feb 5, 2021, 12:44:01 AM2/5/21
to rabbitmq-users
Hi Luke,

   In the process of Making RabbitMQ independent of hostname of system, I am using the below steps provided by you and it is working fine. However due to some limitations, I want to avoid the Step3 that is writing fixedhost in hosts file.

Can you please suggest if there is any other way to achieve the same by skipping the Step3 ? 


Steps :
======
Step 1 : Stopping RabbitMQ service
                   .\rabbitmq-service.bat stop

Step 2: Removing RabbitMQ service
                   .\rabbitmq-service.bat remove

Step 3: Renaming RabbitMQ cluster node. NOTE: fixedhost is in            C:\Windows\System32\drivers\etc\hosts at this point

Step 4: Rename cluster command
          .\rabbitmqctl.bat rename_cluster_node rabbit@WIN81 rabbit@fixedhost

Step 5: Moving RabbitMQ data directories

           move %AppData%\RabbitMQ\db\rabbit@WIN81-mnesia  %AppData%\RabbitMQ\db\rabbit@fixedhost-mnesia
           move %AppData%\RabbitMQ\db\rabbit@WIN81-plugins-expand %AppData%\RabbitMQ\db\rabbit@fixedhost-plugins-expand

Step 6: Creating custom configuration file for NODENAME
                          vim %AppData%\RabbitMQ\rabbitmq-env-conf.bat

Step 7: Re-install RabbitMQ service
                       .\rabbitmq-service.bat install
                        .\rabbitmq-service.bat start


Thanks & Regards,
Badri.


Luke Bakken

unread,
Feb 5, 2021, 9:45:23 AM2/5/21
to rabbitmq-users
Hello,

Your RabbitMQ host name (the part after the "@" sign) must resolve in DNS somehow. The easiest way is to write it to the hosts file. You could also use real DNS to do it. Finally, I think you can use the "inetrc" feature of the Erlang VM to set a host name / IP address but I have never tried:


You would configure RabbitMQ to use your file by creating the %AppData%\RabbitMQ\rabbitmq-env-conf.bat file with this content:

set SERVER_ADDITIONAL_ERL_ARGS=C:/path/to/erl_inetrc

Then, follow the re-installation procedure.

Thanks,
Luke

Reply all
Reply to author
Forward
0 new messages