Knowledge Base Administration Guide

Install RabbitMQ

If you have not installed RabbitMQ in your data center, this documents how to download and install it.

Notes:

  1. To install RabbitMQ, you need root privileges (or a user which can run sudo or services)
  2. RabbitMQ runs as a service, on a single machine, and clients connect to it from compute machines.
  3. RabbitMQ requires the Erlang language to be installed first. See instructions below.

Download and Install RabbitMQ


RHEL/CentOS instructions for RabbitMQ

Erlang and RabbitMQ can either be installed from central RPM's (ie from Redhat), or from Github RPM's:

# Example Erlang download/install
# → OPEN the link above to find the latest version

> wget https://github.com/rabbitmq/erlang-rpm/releases/download/<VERSION>.x86_64.rpm
> sudo yum localinstall erlang-<VERSION>.x86_64.rpm
# Example RabbitMQ download/install
# → OPEN the link above to find the latest version

> wget https://github.com/rabbitmq/rabbitmq-server/releases/download/<VERSION>/rabbitmq-server-3.<VERSION>.rpm
> sudo yum localinstall rabbitmq-server-<VERSION>.noarch.rpm
> sudo chkconfig rabbitmq-server on
  • Start RabbitMQ service
> sudo service rabbitmq-server start
  • Check RabbitMQ status
> sudo service rabbitmq-server status -l
Redirecting to /bin/systemctl status rabbitmq-server.service
● rabbitmq-server.service - RabbitMQ broker
   Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2020-04-01 17:51:45 CDT; 10min ago
 Main PID: 3926 (beam.smp)
   Status: "Initialized"
    Tasks: 85
   CGroup: /system.slice/rabbitmq-server.service
           ├─3926 /usr/lib64/erlang/erts-10.7/bin/beam.smp -W w -A 64 -MBas ageffcbf -MH...
           ├─4110 /usr/lib64/erlang/erts-10.7/bin/epmd -daemon
           ├─4248 erl_child_setup 32768
           ├─4269 inet_gethost 4
           └─4270 inet_gethost 4

Apr 01 17:51:44 rhel7.simscope rabbitmq-server[3926]: Doc guides: https://rabbitmq.com/documentation.html
Apr 01 17:51:44 rhel7.simscope rabbitmq-server[3926]: Support:    https://rabbitmq.com/contact.html
Apr 01 17:51:44 rhel7.simscope rabbitmq-server[3926]: Tutorials:  https://rabbitmq.com/getstarted.html
Apr 01 17:51:44 rhel7.simscope rabbitmq-server[3926]: Monitoring: https://rabbitmq.com/monitoring.html
Apr 01 17:51:44 rhel7.simscope rabbitmq-server[3926]: Logs: /var/log/rabbitmq/rabbit@rhel7.log
Apr 01 17:51:44 rhel7.simscope rabbitmq-server[3926]: /var/log/rabbitmq/rabbit@rhel7_upgrade.log
Apr 01 17:51:44 rhel7.simscope rabbitmq-server[3926]: Config file(s): (none)
Apr 01 17:51:45 rhel7.simscope rabbitmq-server[3926]: Starting broker...systemd unit for activation check: "rabbitmq-server.service"
Apr 01 17:51:45 rhel7.simscope systemd[1]: Started RabbitMQ broker.
Apr 01 17:51:46 rhel7.simscope rabbitmq-server[3926]: completed with 0 plugins.

Default RabbitMQ values

For reference, here are the default values that RabbitMQ is set with:

FieldDefault Value
Network port5672
Config File/usr/local/etc/rabbitmq/rabbitmq.conf or /etc/rabbitmq/rabbitmq-env.conf
rabbitmqctl/sbin/rabbitmqctl
Log directory/var/log/rabbitmq
Data directory/var/lib/rabbitmq

Note: the RabbitMQ Server Network port may be changed via rabbitmq-env.conf:

  • NODE_PORT=5672

Set up Rabbit authentication

Please see the rabbitmqctl page to set up client user-authentication.


RabbitMQ Config

RabbitMQ configuration is documented at:

Data directory

By default the database is stored at:

${install_prefix}/var/lib/rabbitmq/mnesia

To change the directory, edit /etc/rabbitmq/rabbitmq-env.conf and add:

RABBITMQ_MNESIA_BASE=/disk/rabbitmq
RABBITMQ_LOG_BASE=/disk/rabbitmq/log

If you are using the RabbitMQ web administration console and want to change the default cookie timeout to 30 days, add the following to your rabbitmq.conf file:

# 30 day authentication
management.login_session_timeout = 43200