When installing RabbitMQ using zstack-ctl install_rabbitmq
you may encounter a failure caused by
unable to start RabbitMQ server, the error message in /tmp/zstack_installation.log is like:
TASK: [enable RabbitMQ] *******************************************************
failed: [192.168.0.199] => {"failed": true}
msg: Starting rabbitmq-server: FAILED - check /var/log/rabbitmq/startup_{log, _err}
rabbitmq-server.
This is most likely caused by you have changed your hostname and a previous RabbitMQ server still retains an old hostname. RabbitMQ relies on hostname as node name, changing hostname may cause issues that you can find details in RabbitMQ in Amazon EC2(see details in section "Issues with hostname").
As the tool rabbitmqctl
may have failed because of hostname change, you may need to stop all running RabbitMQ related
processes by Linux kill
command with -9
option.
service rabbitmq-server stop
will mislead you that the RabbitMQ server is stopped but if you
ps -aux | grep rabbitmq
you will see a bunch of RabbitMQ process still running. So please use ps
to check your system before proceeding.
If you haven't logout/login shell sessions after changing the hostname, the environment variable HOSTNAME will remain
to the old one that fails rabbitmqctl
. You can change the $HOSTNAME
by:
export HOSTNAME=`hostname`
or simply logout then login your shell
Now you can start the server by:
service rabbitmq-server start