Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

326
Views
Rabbit MQ changing hostname while preserving rabbitMQ artifacts and messages

This question is regarding rabbitmq config I hope this question is appropriate for stackoverflow forum. Please point me to right forum if it isnt

My problem statement that I need to to change hostname of a linux server from "thishost" to "thathost" The host "thishost" has RabbitMQ installed on it with a ton of artifacts and messages I need to be able to preserve all the RabbitMQ artifacts such as queues, exchanges and also messages when the hostname changes to "thathost"

I am considering configuration change to enable rabbitmq see old hostname (thishost) despite the name change for linux

To ensure that rabbitmq hostname remains same I peg it to the original hostname by configuring following two parameters in the rabbitmq configuration file

/etc/rabbitmq/rabbitmq-env.conf
...
HOSTNAME=thishost
NODENAME=rabbit@thishost

Having done this change in rabbitmq config, I changed the linux hostname to "thathost" and try to start the rabbitmq service.

The rabbitmq service now refuses to start and the error messages are as follows

service rabbitmq-server start
Job for rabbitmq-server.service failed because the control process exited with error code.
See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.

journalctl -xe
Nov 30 11:20:07 ubuntula1 systemd[1]: Failed to start RabbitMQ Messaging Server.
Nov 30 11:20:18 ubuntula1 systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.

The logfile /var/log/rabbitq shows following error

/var/log/rabbitq 
 ERROR: epmd error for host thishost: nxdomain (non-existing domain)

Any thoughts on

  • how to fix the rabbitmq config
  • any alternative way on making rabbitmq agnostic to hostname
  • is there a better idea to preserve the rabbitmq artifacts across hostnames

Please note I tried following

  1. export import artifacts using rabbitmqctl export__definitions/import_definitions
  2. Store and load messages using rabbitio However as I mentioned I have a ton of artifacts and messages and the rigor involved that approach makes it error prone so I am searching for a less rigorous approach

Thanks much folks

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Going by the error message in logfile "epmd error for host thishost: nxdomain (non-existing domain)"
I stumbled upon this post How to resolve ERROR: epmd error for host nxdomain (non-existing domain)? While this is not directly relevant, it sure provides a tip that a /etc/hosts entry is needed for mapping old hostname to the same ip address.

With alias for old hostname addded in /etc/hosts my problem was solved :-)

SO to sum it up, if you want to change the hostname of your linux host - then you need to do two things to save your artifacts from becoming unusable after hostname change

  1. Change to rabbitmq configuration as I already described /etc/rabbitmq/rabbitmq-env.conf ... HOSTNAME=thishost

  2. Make an alisas in my /etc/hosts to add old hostname mapping to ip address in addition to new hostname as follows

    /etc/hosts ... a.b.c.d thathost thishost

That solved my problem and rabbitmq starts fine with all existing artifacts intact after hostname change

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!