How to install rabbitmq on centos7, a must for novice [detailed tutorial]

Environment: CentOS-7;

Linux kernel version: CentOS Linux release 7.8.2003 # ps: Query linux kernel command: cat /etc/redhat-release

1. Download the installation file

We all know that java software requires jre to run, which is the operating environment. So, in the same way, RabbitMQ also needs its operating environment to run.

RabbitMQ is developed in erlang language, so we need to have an erlang environment.

Note: If you do not have version restrictions, please execute it as it is according to the version I give below, and run it with you.

#下载erlang
wget http://www.rabbitmq.com/releases/erlang/erlang-17.4-1.el6.x86_64.rpm 
#下载rabbitmq-server
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.1/rabbitmq-server-3.5.1-1.noarch.rpm 

Note: Many tutorials are downloaded directly through yum, if it is unregistered will certainly appear This system is not registered with an entitlement  server You can use subscription-manager to register.. Questions like;

This is because Red Hat’s Enterprise Linux system RHEL is charged and must be registered before it can be used normally.

At this time we have to find a way. Replace the original version of yum and install a free yum source-->CentOS (CentOS has been acquired by Red Hat and is not much different from the RHEL system, the most important thing is that it can be used for free);

If you insist on downloading using yum, how do you install a free yum source on Baidu? I gave up this path because of unsuccessful attempts. The ultimate goal was to successfully install rabbitmq, so there was more than one way, so I took another approach. Recommend to everyone;

2. Install erlang and RabbitMQ-Server

yum install erlang-17.4-1.el6.x86_64.rpm 
yum install rabbitmq-server-3.5.1-1.noarch.rpm
//或者采用rpm方式离线安装,执行比yum快些;推荐下面这种方式
rpm -ivh rabbitmq-server-3.5.1-1.noarch.rpm

3. Modify the configuration file && release port 15672

After the second step, many students cannot jump to the management page when accessing http://ip:15672 through the browser. This is because you have not enabled remote access and the firewall has not released the default 15672 during mq installation. port;

1. Modify the configuration file

cp /usr/share/doc/rabbitmq-server-3.4.1/rabbitmq.config.example /etc/rabbitmq/rabbitmq.config
vim /etc/rabbitmq/rabbitmq.config

vim enters the editing page, directly / search, search for "loopback" and press Enter, and then modify the content as follows: Remember! Remove the percent sign and follow the comma! ! !

Change "%% {loopback_users, []},", to " {loopback_users, []}"

2. Release port 15672 or close the firewall

I turned off the firewall directly! Hey, worry-free, it's nice, it's great, after all, I changed some ports and added them to the whitelist before, as if I remember that I didn't change it successfully, so it's convenient to play.

systemctl status firewalld  ||  service iptables status #查看防火墙状态
systemctl stop firewalld  ||  service iptables stop   # 关闭防火墙

4. Restart

Several commonly used commands (open, close, view status)

//开始
systemctl start rabbitmq-server
//停止
systemctl stop rabbitmq-server
//重启
systemctl restart rabbitmq-server
//查看状态
systemctl status rabbitmq-server

Remember to modify the configuration file, rabbitmq must be restarted, otherwise the configuration will not take effect!

5. Login to access

At this point, when you visit http://ip:15672 again, you can enter the login page.

The first time you need to log in, the default account password is: `guest/guest`

Well, the above is the installation of rabbitmq and how to solve some common problems, which are summarized above.


Previous recommendations:

1. Record RabbitMQ startup error: Starting rabbitmq-server (via systemctl) [Detailed tutorial]

2. Springboot integrates rabbitmq simple gameplay, demo case demonstration novice tutorial [with complete case code]

3. Rabbitmq introduction and installation tutorial, a must for programmers to enter the pit!


❤If the article is helpful to you, please click like at the top right corner of the article or at the end of the article! (づ ̄ 3 ̄)づ 

❤If you like the articles shared by the white rabbit, please pay attention to the white rabbit! (๑′ᴗ‵๑)づ╭❤~

❤If you have any questions about the article, please leave a message below or join the group to discuss [group number: 708072830]

❤In view of the limited personal experience, all opinions and technical research points, if you have any objections, please reply directly to the discussion (do not make offensive remarks)

Guess you like

Origin blog.csdn.net/weixin_43970743/article/details/113250182