RabbitMQ is an open-source message broker, which can be used to greatly enhance the speed of Magento 2's message processing queue. Installation is relatively straightforward. Note that you'll need a dedicated (cloud) server as this won't work on a shared or business hosting package, and it's recommended to speak to your systems administrator (that's us if you're a managed hosting customer) to install this for you.
- Install socat
The first step in our journey is to enable the epel-release repository on the server so that we can install the latest version of socat, a prerequisite for step 2. Please SSH into your server as the root user, or use sudo to escalate to root priviledges.
sudo yum install epel-release
sudo yum update
sudo yum install socat
- Download erlang
Next, we need to download the latest version of erlang, the programming language that RabbitMQ is written in, ready for the install of the final server.
Please check erlang's download page to ensure you're getting the latest version of the software, and replace the wget link with the latest version where necessary.
sudo yum install esl-erlang_22.0.7-1~centos~7_amd64.rpm
- Download RabbitMQ
Finally, we're ready to download and install RabbitMQ server.
As above, make sure you check RabbitMQ's download page and replace the wget link with the latest version available for download.
sudo rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
sudo yum install rabbitmq-server-3.7.17-1.el7.noarch.rpm
- Start RabbitMQ Server
Now that RabbitMQ has been installed, it's time to start the server.
sudo systemctl start rabbitmq-server
sudo systemctl status rabbitmq-server
If all went well, you should see that the status of RabbitMQ is "active"which means it's all running and ready to be configured.
- Enable RabbitMQ Web Management
Last but not least, we need to enable RabbitMQ's web management plugin so that we can easily administer the server, and create a new administrator user to log in to it.
sudo rabbitmq-plugins enable rabbitmq_management
sudo chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/
sudo rabbitmqctl add_user Admin01 ChAngEmE321
sudo rabbitmqctl set_user_tags Admin01 administrator
sudo rabbitmqctl set_permissions -p / Admin01 ".*" ".*" ".*"
Assuming all went well, you should now be able to log in to the web management console at http://Your_Server_IP:15672/ using the above username and password. Make sure you log in and change the password to something more secure right away!
All done! RabbitMQ is now ready to be configured with your Magento installation.