This article mainly focuses on installing RabbitMQ using RPM packages, without addressing the source compilation method.
As the latest installation packages do not support CentOS 7, we can only choose version 3.9.x or lower. You can find the download link here: GitHub Download Link.
In this context, el7 refers to CentOS 7, while el8 refers to CentOS 8.
Before installation, it’s important to install the necessary dependencies: Erlang and socat. Otherwise, you may encounter the following error:
- Installing socat
Installing socat is quite straightforward; simply execute the following command:
yum -y install socat
- Installing Erlang
Erlang cannot be installed casually; it must correspond to the version of RabbitMQ you plan to install. The official reference for compatible versions can be found here: https://www.rabbitmq.com/which-erlang.
For older versions, refer to: https://www.rabbitmq.com/which-erlang#eol-series.
To install RabbitMQ version 3.8, you’ll need Erlang version 23.2 to 24.2. Find the corresponding version and download it from the official GitHub repository: https://github.com/rabbitmq/erlang-rpm/releases.
!!! Pitfall Alert !!! Regardless of whether previous installations failed, you must execute the following commands:
Check for existing Erlang installations: rpm -qa | grep erlang
.
To batch uninstall any existing Erlang remnants on the server, run: rpm -qa | grep erlang | xargs rpm -e --nodeps
.
Failing to do this may lead to various inexplicable errors. Once confirmed, proceed with installing Erlang using rpm -ivh erlang-23.3.4.8-1.el7.x86_64.rpm
.
- Installing RabbitMQ
You can install RabbitMQ by executing: rpm -ivh rabbitmq-server-3.8.30-1.el7.noarch.rpm
.