1. Check the relationship between the RabbitMQ version and Erlang version
RabbitMQ Erlang Version Requirements
The diagram below:
If you want to install RabbitMQ version 3.8.12, Erlang will need to be in the 22.3-23.x range
2. Install Erlang
On the right of the page, click Install:RPM-based Linux to Install iT on centos
RabbitMQ official Linux installation document
Then search for Install RabbitMQ Server on the new page and find the following
install a recent Erlang version via yum. Click in, the page is as follows:
Copy the command and run it on centos
This command is the pre-installation script for Erlang;
Once the installation is complete, you can install Erlang
# yum install ErlangCopy the code
After Erlang is installed, use the erl command to check
[root@localhost ~]# erl Erlang/OTP 23 [ERTS-11.1.8] [source] [64-bit] [SMP :1:1] [DS :1:1:10] [Async-Threads :1] [HIPE] Eshell V11.1.8 (Abort with ^G) 1>Copy the code
If you can access Eshell, the installation is successful.
We’ll use yum list | grep Erlang command to check the version of Erlang
/ root @ localhost ~ # yum list | grep Erlang Erlang. X86_64 23.2.5-1. El7 @ rabbitmq_erlang root @ localhost ~ #Copy the code
The Erlang environment is already installed.
3. Install RabbitMQ Server
Go back to the installation documentation page, again under Install RabbitMQ Server
[root@localhost ~]# rpm --import https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
[root@localhost ~]# rpm --import https://packagecloud.io/gpg.key
Copy the code
These two commands are executed without any prompt
After executing, we go to the Package Cloud at the bottom of the page and click there
The new page looks like this. Remember to select RPM for Base Scripts on the left
Once that’s done, let’s go back to the installation documentation page and searchDownload the Server, find the following page
Right click to copy the link to centos and use the wget command to download
You can also click download and upload to centos
After the download is complete, run the RPM command to install it
[root@localhost software]# RPM -ivh rabbitmq-server-3.8.12-1.el7.noarch. RPM warning: rabbitmq-server-3.8.12-1.el7.noarch. Header V4 RSA/SHA256 Signature, key ID 6026DFCA: Rabbitmq-server-3.8.12-1.el7.noarch requires [root@localhost software]#Copy the code
There is a warning and an error
- Address this warning first, key ID 6026DFCA: NOKEY
Let’s go back to the installation documentation pageDownload the ServerUp here, or just search for itRabbitMQ public signing keyFind the following
- Rabbitmq-server-3.8.12-1.el7.noarch dependency check failed: socat required by Rabbitmq-server-3.8.12-1.el7.noarch
Run the yum install socat command to install socat
yum install socat
Copy the code
After the preceding two steps are complete, run the RPM -ivh command
[root@localhost software]# RPM -ivh rabbitmq-server-3.8.12-1.el7.noarch. RPM # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [100%] is upgrading/installing... 1: the rabbitmq server - 3.8.12-1. El7 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # [100%] [root @ localhost software] #Copy the code
100% indicates the installation is successful.
4. The configuration of the RabbitMQ
Open the RabbitMQ Configuration Configuration wizard page: https://www.rabbitmq.com/configure.html
Search rabbitmq.conf.example
The current url is github.com/rabbitmq/ra…
Then create a new configuration file, rabbitmq.conf, and copy the contents to the new configuration file
You can click on the pen icon on the right, edit it, and then go to Copy, or you can hit Raw.
- When the copy is done, then therabbitmq.confCopy configuration files to/etc/rabbitmqdirectory
Configure the remote login function
In earlier versions of RabbitMQ, you need to add the following configuration to enable remote login from other IP addresses. If you do not add the following configuration, you can only log in to the server running RabbitMQ from other IP addresses or network segments
{loopback_users, []}
Copy the code
This configuration cannot be added to RabbitMQ 3.8 and will cause an error.
The following configuration is used for RabbitMQ 3.8
loopback_users.guest = false
Copy the code
In the configuration file, leave this section of configuration comment alone
## Uncomment the following line if you want to allow access to the
## guest user from anywhere on the network.
loopback_users.guest = false
Copy the code
- Enable the RabbitMQ plug-in function
rabbitmq-plugins enable rabbitmq_management
Copy the code
- Set rabbitMQ to start upon startup
chkconfig rabbitmq-server on
Copy the code
- Start the rabbitmq
service rabbitmq-server start
Copy the code
- Close the rabbitmq
service rabbitmq-server stop
Copy the code
- Restart the rabbitmq
service rabbitmq-server restart
Copy the code
Start after the rabbitmq, visit http://192.168.10.222:15672/
User name: guest
Password: guest
After logging in, navigate to TAB, select Admin, and then add a user
The admin user does not have any permission No access
Click on the name to set permissions