Skip to main content

CentOS8 Installing RabbitMQ [Pure Installation Manual]

CentOS8 Installing RabbitMQ [Pure Installation Manual]

installation steps

  1. Prepare environment

  2. Install erlang

  3. Install RabbitMQ

Release Notes

erlang:25.1.2

RabbitMQ: 3.11.6

Version comparison table

Steps

Note: The following commands are all operated by the root user.

Environment configuration

Download Centos-8.repo

  ### Just choose one of the ways



# wget

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo



# curl

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo



Generate cache

 
yum makecache

Update yum

 
yum update

Install erlang

Since rabbitmq is developed based on the erlang language, erlang must be installed first

Install dependencies

 
yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto perl wget gtk2-devel binutils-devel

erlang official website download address

Erlang's github download address

You can download this software accelerator by visiting github

Solve the problem of slow access to github or failure to open resources-CSDN library

Prepare resource package storage path

  mkdir -p /opt/rabbitmq

cd /opt/rabbitmq



# Put the downloaded package in this directory

# otp_src_25.1.2.tar.gz



Unzip

 
tar -zxvf otp_src_25.1.2.tar.gz

Install

  # Modify the catalog



mkdir /usr/local/soft

mv otp_src_25.1.2 /usr/local/soft/



# Switching directories



cd /usr/local/soft/otp_src_25.1.2/



# Create a directory to store the installation



mkdir ../erlang



# Configure the installation path



./configure --prefix=/usr/local/soft/erlang



# Installation



make install








![CentOS8 Installing RabbitMQ \[Pure Installation Manual\]](8e47ec765c326fd1a360e642ec3ca91f.png)

Check if the installation is successful

  ll /usr/local/soft/erlang/bin



# The display reads as follows

total 0

lrwxrwxrwx 1 root root 24 Jan 7 09:28 ct_run -> ../lib/erlang/bin/ct_run

lrwxrwxrwx 1 root root 26 Jan 7 09:28 dialyzer -> ../lib/erlang/bin/dialyzer

lrwxrwxrwx 1 root root 22 Jan 7 09:28 epmd -> ../lib/erlang/bin/epmd

lrwxrwxrwx 1 root root 21 Jan 7 09:28 erl -> ../lib/erlang/bin/erl

lrwxrwxrwx 1 root root 22 Jan 7 09:28 erlc -> ../lib/erlang/bin/erlc

lrwxrwxrwx 1 root root 25 Jan 7 09:28 escript -> ../lib/erlang/bin/escript

lrwxrwxrwx 1 root root 25 Jan 7 09:28 run_erl -> ../lib/erlang/bin/run_erl

lrwxrwxrwx 1 root root 24 Jan 7 09:28 to_erl -> ../lib/erlang/bin/to_erl

lrwxrwxrwx 1 root root 23 Jan 7 09:28 typer -> ../lib/erlang/bin/typer



Configure environment variables

  # Add environment variables



echo 'export PATH=$PATH:/usr/local/soft/erlang/bin' >> /etc/profile



# Refresh environment variables



source /etc/profile



Verify it

  erl



Erlang/OTP 25 [erts-13.1.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]



Eshell V13.1.2 (abort with ^G)

1>



# Type halt(). Exit or ctrl + C twice



The above erlang installation is completed


Install RabbitMQ

Download and unzip

RabbitMQ official download address

RabbitMQ github download address

  # Downloaded files are placed in this directory



cd /opt/rabbitmq/



# rabbitmq-server-generic-unix-3.11.6.tar.xz

7.

# Unzip (you have to unzip twice)

9.

xz -d rabbitmq-server-generic-unix-3.11.6.tar.xz

tar -xvf rabbitmq-server-generic-unix-3.11.6.tar

tar -xvf

# Change the path and switch directories



mv rabbitmq_server-3.11.6/ /usr/local/soft/

cd /usr/local/soft/



# Configure environment variables and refresh.



echo 'export PATH=$PATH:/usr/local/soft/rabbitmq_server-3.11.6/sbin' >> /etc/profile

source /etc/profile







Start command and verification

  # Enter the sbin directory



cd rabbitmq_server-3.11.6/sbin/



# Start the command



rabbitmq-server -detached



# View status



rabbitmqctl status



# Stop the command



rabbitmqctl stop



# Start the web plugin



rabbitmq-plugins enable rabbitmq_management

21.

# Access it.

23.

curl own server IP:15672


After the above installation is completed, start configuring user permissions.

User Management

  # View all users



rabbitmqctl list_users



Add a user



rabbitmqctl add_user renfy 123456



# The following error occurs, indicating that the user has not been given permissions

Adding user "renfy" ... 11. Done.

Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more. 12. 13. # Configure permissions.

13. # Configure permissions

15. rabbitmqctl set_permissions -p "/" renfy ". *" ". *" ". *"

17. # Viewing Permissions

19. rabbitmqctl list_user_permissions renfy

21. # Set the tag

23. rabbitmqctl set_user_tags renfy administrator

25. # Remove for security reasons.

27. rabbitmqctl delete_user guest


Finally, restart RabbitMQ and access http://IP:15672 through the browser.

Note: The server firewall needs to close or allow port 15672