Linux-centos install rabbitmq3.6.6

1. Choose the rpm package suitable for the operating system

This article uses the rpm package to install rabbitmq, first check the operating system and make sure to download the corresponding version of rpm:

[root@study opt]# cat /etc/redhat-release 
CentOS release 6.5 (Final)

Mine is centos6.5, so I need to download the rpm package of centos6, which is the el6 version. Some people don't know this, and only focus on the rabbitmq version, ignoring the operating system that the rpm is suitable for.

Therefore, some installation tutorials use rabbitmq-server-3.6.6-1.el7.noarch.rpm, which is the rpm of el7, to install on centos6, and encounter the problem of upgrading the glibc package. Although the upgrade can also solve the problem, the direction is actually wrong.

Basically all rpm packages will provide the version corresponding to the mainstream operating system, so the correct idea should be to choose to download the rpm package corresponding to the operating system.

# 两个包一对比就很清晰了,centos6对应el6,centos7对应el7
# centos6对应的rpm
rabbitmq-server-3.6.6-1.el6.noarch.rpm

# centos7对应的rpm
rabbitmq-server-3.6.6-1.el7.noarch.rpm

2. Download the relevant rpm package

Linux installation rabbitmq generally requires three rpm packages, namely: socat, erlang, rabbitmq-server

socat download address: http://repo.iotti.biz/CentOS/6/x86_64/

erlang download address: https://www.rabbitmq.com/releases/erlang/

Rabbitmq-server download address: https://www.rabbitmq.com/releases/rabbitmq-server/

Important: Before downloading, you need to understand that the Erlang environment matches the RabbitMQ version: https://www.rabbitmq.com/which-erlang.html , and then download the corresponding version, otherwise the version will not match and the installation will fail.

If you don’t want to choose by yourself, you can also download the following versions directly, but the versions used are all older, as follows:

# 个人习惯下载到/opt目录。如果是内网不能直接wget,就外网下载好了再上传到目标服务器
# socat
wget http://repo.iotti.biz/CentOS/6/x86_64/socat-1.7.3.2-1.el6.lux.x86_64.rpm

# erlang
wget https://www.rabbitmq.com/releases/erlang/erlang-18.3-1.el6.x86_64.rpm

# rabbitmq-server
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1.el6.noarch.rpm

3. Install rabbitmq

# 1.进入目录并查看下载好的rpm包
[root@study ~]# cd /opt/ && ll
-rw-r--r--. 1 root root 18585932 8月  15 2016 erlang-19.0.4-1.el6.x86_64.rpm
-rw-r--r--. 1 root root  5487359 11月 23 2016 rabbitmq-server-3.6.6-1.el6.noarch.rpm
-rw-r--r--. 1 root root   277640 6月  23 2017 socat-1.7.3.2-1.el6.lux.x86_64.rpm
[root@study opt]# 

# 2.依次安装

rpm -ivh erlang-19.0.4-1.el6.x86_64.rpm
rpm -ivh socat-1.7.3.2-1.el6.lux.x86_64.rpm
rpm -ivh rabbitmq-server-3.6.6-1.el6.noarch.rpm

4. Configure rabbitmq

# rabbitmq默认的guest用户是不能登录的,需要进行配置rabbit.app文件才能登录
[root@study opt]# vi /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.6/ebin/rabbit.app

# 找到这行:
{loopback_users, [<<"guest">>]},

# 改为这样,注意最后的逗号不能少
{loopback_users, []},

5. Start the web management plugin

# rabbitmq默认是不能从web端登录访问的,需要启用插件
[root@study ebin]# rabbitmq-plugins enable rabbitmq_management

# 启用后,就能访问web端了

6. Log in to the web management terminal

Start rabbitmq-server

# 启动
[root@study ebin]# service rabbitmq-server start
Starting rabbitmq-server: SUCCESS
rabbitmq-server.
[root@study ebin]#

# 关闭防火墙
[root@study ebin]# service iptables stop
iptables:将链设置为政策 ACCEPT:filter                    [确定]
iptables:清除防火墙规则:                                 [确定]
iptables:正在卸载模块:                                   [确定]
[root@study ebin]# 

Browser input: http://<IP_ADDRESS>:15672, replace <IP_ADDRESS> with your own IP address.

The effect is as follows:

Default login name: guest, password: guest

Operations such as creating users, changing passwords, and creating message queues can be easily completed on the web management end, which is very convenient.

Guess you like

Origin blog.csdn.net/ct_666/article/details/112292202