[rabbitmq-discuss] hostname change

Matthias Radestock matthias at rabbitmq.com
Fri Feb 1 10:44:47 GMT 2013


Fred,

On 29/01/13 19:56, Dushin Fred wrote:
> I am using the RABBITMQ_NODENAME environment variable, but that
> appears to only set the first part of the node name.

RABBITMQ_NODENAME can contain the full node name, and indeed generally 
should since otherwise...

> The directory name (under ${RABBITMQ_MNESIA_BASE}) does not contain
> the @$HOSTNAME suffix, but if I do a recursive grep through the
> directory, I still find artifacts with my previous host name.

...which is bad since a change in hostname would result in rabbit 
attempting to work with an mnesia db that is tied to a different node 
(i.e. containing the old hostname).

> And a hostname reset (and
> reboot) results in a fresh DB, even if I start the broker by
> explicitly setting HOSTNAME to the previous value.

That is odd. The startup scripts construct the node name from $HOSTNAME 
if the latter is set. See 
http://hg.rabbitmq.com/rabbitmq-server/file/fefbea5d28eb/scripts/rabbitmq-env#l37. 
And provided you haven't also set RABBITMQ_NODENAME, which would 
override that setting.

And a quick experiment confirms that is working as expected.

Note though that $HOSTNAME must be resolvable, or you'll see something like

ERROR: epmd error for host "oldhost": nxdomain (non-existing domain)

on startup.


Regards,

Matthias.


More information about the rabbitmq-discuss mailing list