打開官網:http://www.rabbitmq.com/download.html

點擊
進入另一個頁面

向下拉,文檔提供給我們一個有用的幫助,第一個是查看RabbitMQ與erlang版本對應關系,第二個是Erlang的GitHub地址

點擊第一個鏈接:http://www.rabbitmq.com/which-erlang.html

點擊第二個鏈接:https://github.com/rabbitmq/erlang-rpm/releases

可以看到打包的,For CentOS6 或 7

到此為止:我下載了兩個文件


下面開始安裝。
先上傳到CentOS7,我用的FileZilla,上傳到/soft目錄了,這個目錄自定義

然后定位到要安裝的。
[admin@localhost ~]$ su root Password: [root@localhost admin]# cd /soft/ [root@localhost soft]# ll total 299536 -rw-r--r--. 1 root root 18478672 Mar 30 06:58 erlang-20.3-1.el7.centos.x86_64.rpm -rw-r--r--. 1 root root 189756259 Mar 26 06:27 jdk-8u161-linux-x64.tar.gz -rw-r--r--. 1 root root 49766096 Mar 26 06:27 kafka_2.11-1.0.1.tgz -rw-r--r--. 1 root root 12045148 Mar 30 06:58 rabbitmq-server-3.7.4-1.el7.noarch.rpm -rw-r--r--. 1 root root 36668066 Mar 26 06:27 zookeeper-3.4.11.tar.gz [root@localhost soft]#
先安裝Erlang。
rpm -ivh erlang-20.3-1.el7.centos.x86_64.rpm
安裝過程
[root@localhost soft]# rpm -ivh erlang-20.3-1.el7.centos.x86_64.rpm warning: erlang-20.3-1.el7.centos.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 6026dfca: NOKEY Preparing... ################################# [100%] Updating / installing... 1:erlang-20.3-1.el7.centos ################################# [100%] [root@localhost soft]# rpm -qa | grep erlang erlang-20.3-1.el7.centos.x86_64 [root@localhost soft]#
然后安裝RabbitMQ
[root@localhost soft]# rpm -ivh rabbitmq-server-3.7.4-1.el7.noarch.rpm warning: rabbitmq-server-3.7.4-1.el7.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 6026dfca: NOKEY error: Failed dependencies: socat is needed by rabbitmq-server-3.7.4-1.el7.noarch
好吧,先安裝socat。
yum install -y socat
這里說一下,erlang和RabbitMQ我沒有使用yum來安裝,是讓大家搞清依賴關系(erlang和RabbitMQ之間是有版本依賴關系的)
安裝完出現:

現在可以安裝RabbitMQ了
[root@localhost soft]# rpm -ivh rabbitmq-server-3.7.4-1.el7.noarch.rpm warning: rabbitmq-server-3.7.4-1.el7.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 6026dfca: NOKEY Preparing... ################################# [100%] Updating / installing... 1:rabbitmq-server-3.7.4-1.el7 ################################# [100%] [root@localhost soft]#
安裝管控台插件
[root@localhost soft]# rabbitmq-plugins enable rabbitmq_management The following plugins have been configured: rabbitmq_management rabbitmq_management_agent rabbitmq_web_dispatch Applying plugin configuration to rabbit@localhost... The following plugins have been enabled: rabbitmq_management rabbitmq_management_agent rabbitmq_web_dispatch started 3 plugins. [root@localhost soft]# systemctl start rabbitmq-server
接着,打開虛擬機本地的瀏覽器,輸入
http://localhost:15672/
會讓你輸入賬號密碼,全部都輸:guest
這里有個問題,你只能本地訪問。如果你使用guest在外部訪問的話(使用windows下的瀏覽器)

那么也可以解決,添加一個用戶即可,打開本地的瀏覽器,進入控制台

添加之后,就可以在外部訪問了
先打開防火牆
[root@localhost soft]# firewall-cmd --zone=public --add-port=15672/tcp --permanent success [root@localhost soft]# systemctl restart firewalld

查看我們的用戶

