Centos7安装RabbitMQ3.7.13详细教程

安装RabbitMQ

安装erlang依赖

yum install -y epel-release

yum install unixODBC unixODBC-devel wxBase wxGTK SDL wxGTK-gl

安装(已经下载好的)

yum install -y esl-erlang_21.3.2-1_centos_7_amd64.rpm 

检查版本

[root@localhost mq]# erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 10.3.1

安装RabbitMQ

yum install -y rabbitmq-server-3.7.13-1.el7.noarch.rpm

出错(然而默认yum仓库中的版本较低)

Error: Package: rabbitmq-server-3.7.13-1.el7.noarch (/rabbitmq-server-3.7.13-1.el7.noarch)
           Requires: erlang >= 20.3
           Available: erlang-R16B-03.18.el7.x86_64 (epel)
               erlang = R16B-03.18.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

vi /etc/yum.repos.d/rabbitmq-erlang.repo

[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/7
gpgcheck=1
gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1
yum clean all
yum makecache

错误

Transaction check error:
  file /usr/bin/epmd from install of erlang-20.3.8.14-1.el7.centos.x86_64 conflicts with file from package esl-erlang-21.3.2-1.x86_64
  file /usr/bin/erl from install of erlang-20.3.8.14-1.el7.centos.x86_64 conflicts with file from package esl-erlang-21.3.2-1.x86_64
  file /usr/bin/erlc from install of erlang-20.3.8.14-1.el7.centos.x86_64 conflicts with file from package esl-erlang-21.3.2-1.x86_64
  file /usr/bin/escript from install of erlang-20.3.8.14-1.el7.centos.x86_64 conflicts with file from package esl-erlang-21.3.2-1.x86_64
  file /usr/bin/run_erl from install of erlang-20.3.8.14-1.el7.centos.x86_64 conflicts with file from package esl-erlang-21.3.2-1.x86_64
  file /usr/bin/to_erl from install of erlang-20.3.8.14-1.el7.centos.x86_64 conflicts with file from package esl-erlang-21.3.2-1.x86_64

Error Summary

yum remove esl-erlang-21.3.2-1.x86_64 esl-erlang-21.3.2-1.x86_64 esl-erlang-21.3.2-1.x86_64 esl-erlang-21.3.2-1.x86_64 esl-erlang-21.3.2-1.x86_64 esl-erlang-21.3.2-1.x86_64

修改配置文件

cp /usr/share/doc/rabbitmq-server-3.7.13/rabbitmq.config.example /etc/rabbitmq/rabbitmq.config
vi /etc/rabbitmq/rabbitmq.config

去掉loopback_users,[]}的注释和逗号

   %% Uncomment the following line if you want to allow access to the
   %% guest user from anywhere on the network.
   {loopback_users, []}

开机启动

chkconfig rabbitmq-server on

启动

rabbitmq-server start

查看状态

rabbitmqctl status

开放端口

firewall-cmd --zone=public --permanent --add-port=4369/tcp
firewall-cmd --zone=public --permanent --add-port=25672/tcp
firewall-cmd --zone=public --permanent --add-port=5671-5672/tcp
firewall-cmd --zone=public --permanent --add-port=15672/tcp
firewall-cmd --zone=public --permanent --add-port=61613-61614/tcp
firewall-cmd --zone=public --permanent --add-port=1883/tcp
firewall-cmd --zone=public --permanent --add-port=8883/tcp
firewall-cmd --reload

启动管理界面

rabbitmq-plugins enable rabbitmq_management

登入

http://192.168.25.128:15672

# 账号 guest
# 密码 guest

你可能感兴趣的:(Centos7安装RabbitMQ3.7.13详细教程)