Skip to content

Instantly share code, notes, and snippets.

@nguyentamvinhlong
Last active July 8, 2021 16:49
Show Gist options
  • Save nguyentamvinhlong/84f7f1f5051ee216130ba2eb11da37dc to your computer and use it in GitHub Desktop.
Save nguyentamvinhlong/84f7f1f5051ee216130ba2eb11da37dc to your computer and use it in GitHub Desktop.
rabbitmq-server change hostname

rabbitmq-server change hostname

Remove the old installation of RabbitMQ to fix this problem. Here are steps to reinstall RabbitMQ. These commands are run as the root user:

Stop RabbitMQ:

rabbitmqctl stop

Change

/etc/hosts

Change

/etc/hostname

Uninstall old RabbitMQ:

dpkg -P rabbitmq-server

Remove RabbitMQ’s database:

rm -rf /var/lib/rabbitmq

Find erlang’s process that is running rabbit:

ps ax | grep rabbit

Kill the listed process

Reinstall RabbitMQ:

apt-get install rabbitmq-server

update rabbitmq config-env

edit at:

/etc/rabbitmq/rabbitmq-env.conf

like content example:

# I am a complete /etc/rabbitmq/rabbitmq-env.conf file.
# Comment lines start with a hash character.
# This is a /bin/sh script file - use ordinary envt var syntax

NODENAME=rabbit@coconut

ref: https://www.rabbitmq.com/man/rabbitmq-env.conf.5.man.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment