Firstly set up a Linux based VM. In my case I set up a minimal install CentOS VM. See my previous post Deploy Cent OS 7 for a guide on that part. The rest of the article assumes that this pre-requisite has been fulfilled. There are many ways to install the packages but I am doing it in the following way as I need a specific version of RabbitMQ required by VMware Cloud Director 10.3.
Install Erlang
RabbitMQ has a dependency on Erlang. We first need to set the repository where we can get the Erlang packages. Due to my version of Rabbit, I will use I need an older version of Erlang than available so needed to do it like this.
Set the repository using curl:
$ curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
Now we can Clear the Yum Cache:
$ yum clean all
Make a new Cache:
$ yum makecache
Now we can install the required Erlang we have downloaded.
$ yum install erlang
Install Rabbit MQ
Now for the Rabbit install itself. Firstly we need to install WGET as the Cent OS machine was a base install
$ sudo yum install wget
Get the required package:
$ wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.34/rabbitmq-server-3.8.34-1.el8.noarch.rpm
Install the package
$ yum -y install rabbitmq-server*.rpm
Check the version to see that it correct
$ rpm -qi rabbitmq-server
Start and Configure Rabbit MQ
Start and enable the RabbitMQ server service
$ systemctl start rabbitmq-server
$ systemctl enable rabbitmq-server
Check the status of the service to see it is running
$ systemctl status rabbitmq-server
In order to connect to the GUI interface of RabbitMQ you need to install the management plugins.
$ rabbitmq-plugins enable rabbitmq_management
Before you can browse to the UI you will most likely need to open the firewall on Cent OS 7 for the required RabbitMQ ports
$ firewall-cmd --add-port={4369,5672,15672,25672}/tcp --permanent
$ firewall-cmd --reload
At this point you can try to browse to the service on port 15672. As you can see, you should get the login prompt. RabbitMQ comes with a default user called guest with the password guest. This is not secure so what we should do is set up our own user and give it administrator privileges.
Return to the SSH session and create a user. In the example I am setting up a user called admin with a password VMware123!
$ rabbitmqctl add_user admin VMware123!
We want to make the user we just created an administrator within RabbitMQ so we set the required tags.
$ rabbitmqctl set_user_tags admin administrator
We can now remove the guest user, either in the GUI or via the CLI.