Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page
Help Center/ Elastic Cloud Server/ Best Practices/ Setting Up an Application/ Manually Deploying RabbitMQ (CentOS 7.4)

Manually Deploying RabbitMQ (CentOS 7.4)

Updated on 2024-11-04 GMT+08:00

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 which the target ECS belongs to. For details, see Adding a Security Group Rule.

Table 1 Security group rule

Direction

Priority

Action

Type

Protocol & Port

Source Address

Inbound

1

Allow

IPv4

TCP: 5672

0.0.0.0/0

Inbound

1

Allow

IPv4

TCP: 15672

0.0.0.0/0

Procedure

  1. Install the dependency package and perl.

    1. Log in to the target ECS.
    2. The image source has been updated to a Huawei Cloud image source. For details, see How Can I Use an Automated Tool to Configure a Huawei Cloud Image Source (x86_64 and Arm)? This facilitates obtaining and updating the system and software.
    3. Run the following command to install the dependency packages:

      yum -y install make gcc gcc-c++ m4 ncurses-devel openssl-devel unixODBC-devel

    4. Run the following command to install perl:

      yum install perl

  2. Install Erlang.

    For details, see Erlang Packages Download.
    1. Run the following commands to add Erlang Solutions repository to your system:

      wget https://packages.erlang-solutions.com/erlang-solutions-2.0-1.noarch.rpm

      rpm -Uvh erlang-solutions-2.0-1.noarch.rpm

      Alternatively, add the repository entry manually.

      rpm --import https://packages.erlang-solutions.com/rpm/erlang_solutions.asc

    2. In the /etc/yum.repos.d/ directory, create a file named rabbitmq-erlang.repo, and add the following to the file:

      cd /etc/yum.repos.d/

      vi rabbitmq-erlang.repo
      [erlang-solutions]
      name=CentOS $releasever - $basearch - Erlang Solutions
      baseurl=https://packages.erlang-solutions.com/rpm/centos/$releasever/$basearch
      gpgcheck=1
      gpgkey=https://packages.erlang-solutions.com/rpm/erlang_solutions.asc
      enabled=1

      Press Esc to exit insert mode. Then, enter :wq to save the settings and exit.

    3. Run the following command to install Erlang:

      sudo yum install erlang

      Run the following command to install esl-erlang:

      sudo yum install esl-erlang

    4. Run the following command to check the installation result:

      erl -version

      If information similar to the following is displayed, Erlang has been installed:

      [root@ecs-rabbitmq ~]# erl -version
      Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 11.1.7

  3. Install RabbitMQ.

    1. Run the following command to go to the home directory:

      cd

    2. Perform the following steps to download the RabbitMQ installation package:
      1. Open RabbitMQ.
      2. Click Get Started.
        Figure 1 Get Started
      3. Click Download+Installation.
        Figure 2 Download+Installation
      4. Select a download address based on the ECS OS. Here, the CentOS 7.x is used as an example.
        Figure 3 Selecting a download address
      5. Run the following command to download the RabbitMQ installation package.

        For example, the download address in 3.b.iv is as follows:

        https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.12/rabbitmq-server-3.8.12-1.el7.noarch.rpm

        Run the following command:

        wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.12/rabbitmq-server-3.8.12-1.el7.noarch.rpm

        If the message Unable to establish SSL connection. is displayed during the download,

        you can add --no-check-certificate to the end of the wget command and repeat it for several times for download.

        For example:

        wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.12/rabbitmq-server-3.8.12-1.el7.noarch.rpm --no-check-certificate

      6. Run the following command to install the RabbitMQ installation package:

        yum install rabbitmq-server-3.8.12-1.el7.noarch.rpm

    3. Start the RabbitMQ after it is installed.

      service rabbitmq-server start

    4. Check the RabbitMQ status.

      service rabbitmq-server status

  4. 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
    Enabling plugins on node rabbit@ecs-rabbitmq:
    rabbitmq_management
    The following plugins have been configured:
      rabbitmq_management
      rabbitmq_management_agent
      rabbitmq_web_dispatch
    Applying plugin configuration to rabbit@ecs-2b36...
    The following plugins have been enabled:
      rabbitmq_management
      rabbitmq_management_agent
      rabbitmq_web_dispatch
    
    started 3 plugins.

  5. Run the following command to create a user:

    rabbitmqctl add_user Username password

    For example, run the following command:

    rabbitmqctl add_user root 123456

  6. 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

  7. 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 '.*' '.*' '.*'

  8. Run the following command to start RabbitMQ on the backend:

    rabbitmq-server -detached

  9. Enter http://EIP:15672 in the address bar to access RabbitMQ. If the following page is displayed, RabbitMQ has been installed.

  10. Enter the username and password of the account created in 5 to go to the RabbitMQ management page.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback