Manually Deploying RabbitMQ (CentOS 7.4)
Overview
The best practices for HUAWEI CLOUD ECS guide you through the manual deployment of RabbitMQ on a Linux ECS. RabbitMQ is a message middleware that uses the Erlang programming language for the Advanced Message Queuing Protocol (AMQP). It originates from the financial system and is used to store and forward messages in the distributed system. Featuring high reliability, scalability, availability, and rich functions, RabbitMQ is widely used.
Prerequisites
The rule listed in the following table has been added to the security group to which the target ECS belongs. For details, see Adding a Security Group Rule.
| Transfer Direction | Type | Protocol | Port/Range | Source |
|---|---|---|---|---|
| Inbound | IPv4 | TCP | 5672 | 0.0.0.0/0 |
| Inbound | IPv4 | TCP | 15672 | 0.0.0.0/0 |
Procedure
- Install the dependency package and perl.
- Install Erlang.
- Run the following command to download the Erlang installation package:
- Run the following command to decompress the package:
After the decompression, the folder otp_src_19.3 is obtained.
- Run the following command to create the erlang folder:
mkdir /usr/local/erlang
- Run the following command to switch to the otp_src_19.3 folder:
cd otp_src_19.3
- Run the following command to check whether the system configuration meets installation requirements:
- Run the following command to compile and install Erlang:
- Configure Erlang environment variables.
- Run the following command to open the profile configuration file:
vi /etc/profile
- Press i to enter editing mode.
- Add the following content to the end of the profile file:
export PATH=$PATH:/usr/local/erlang/bin
- Press Esc to exit the editing mode. Then, enter :wq to save the settings and exit the configuration file.
- Run the following command for the environment variables to take effect:
- Run the following command to open the profile configuration file:
- Run the following command to check the installation result:
If information similar to the following is displayed, Erlang has been installed:
[root@ecs-rabbitmq ~]# erl -version Erlang (ASYNC_THREADS,HIPE) (BEAM) emulator version 8.3
- Install RabbitMQ.
- Run the following command to switch to the home directory:
- Run the following commands to download the RabbitMQ installation package:
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.9/rabbitmq-server-generic-unix-3.6.9.tar.xz
- Run the following command to decompress the package:
- Run the following command to move the decompressed directory to /usr/local/rabbitmq:
mv rabbitmq_server-3.6.9 /usr/local/rabbitmq
- Configure RabbitMQ environment variables.
- Run the following command to open the profile configuration file:
vi /etc/profile
- Press i to enter editing mode.
- Add the following content to the end of the profile file:
export PATH=$PATH:/usr/local/rabbitmq/sbin
- Press Esc to exit the editing mode. Then, enter :wq to save the settings and exit the configuration file.
- Run the following command for the environment variables to take effect:
- Run the following command to open the profile configuration file:
- Run the following command to enable the RabbitMQ management web page:
rabbitmq-plugins enable rabbitmq_management
Information similar to the following is displayed:
[root@ecs-rabbitmq ~]# rabbitmq-plugins enable rabbitmq_management The following plugins have been enabled: amqp_client cowlib cowboy rabbitmq_web_dispatch rabbitmq_management_agent rabbitmq_management Applying plugin configuration to rabbit@ecs-rabbitmq... started 6 plugins.
- Run the following command to create a user:
rabbitmqctl add_user Username password
For example, run the following command:
rabbitmqctl add_user root 123456
- Run the following command to set the user as the administrator:
rabbitmqctl set_user_tags Username administrator
For example, run the following command:
rabbitmqctl set_user_tags root administrator
- Run the following command to assign all permissions to the user:
rabbitmqctl set_permissions -p / Username '.*' '.*' '.*'
For example, run the following command:
rabbitmqctl set_permissions -p / root '.*' '.*' '.*'
- Run the following command to start RabbitMQ on the backend:
rabbitmq-server -detached
- Enter http://EIP:15672 in the address bar to visit RabbitMQ. If the following page is displayed, RabbitMQ has been installed.

- Enter the username and password of the account created in Step 5 to switch to the RabbitMQ management page.

Last Article: Manually Deploying GitLab (CentOS 7.2)
Next Article: Manually Building a Ghost Blog
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.