centos6安装rabbitmq

Posted sky-cheng

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos6安装rabbitmq相关的知识,希望对你有一定的参考价值。

一、安装依赖包

yum install  build-essential openssl openssl-devel unixODBC unixODBC-devel  make gcc gcc-c++ kernel-devel m4 ncurses-devel tk tc xz

二、下载erlang

wget https://packages.erlang-solutions.com/erlang/esl-erlang/FLAVOUR_1_general/esl-erlang_21.0.5-1~centos~6_amd64.rpm

三、下载rabbitmq

wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.14/rabbitmq-server-3.7.14-1.el6.noarch.rpm

四、安装erlang

rpm -ivh esl-erlang_21.0.5-1~centos~6_amd64.rpm

报错

warning: esl-erlang_21.0.5-1~centos~6_amd64.rpm: Header V4 RSA/SHA1 Signature, key ID a14f4fca: NOKEY
error: Failed dependencies:
        libwx_baseu-2.8.so.0()(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_baseu-2.8.so.0(WXU_2.8)(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_baseu_xml-2.8.so.0()(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_adv-2.8.so.0()(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_adv-2.8.so.0(WXU_2.8)(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_aui-2.8.so.0()(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_aui-2.8.so.0(WXU_2.8)(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_aui-2.8.so.0(WXU_2.8.5)(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_core-2.8.so.0()(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_core-2.8.so.0(WXU_2.8)(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_core-2.8.so.0(WXU_2.8.10)(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_gl-2.8.so.0()(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_gl-2.8.so.0(WXU_2.8)(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_html-2.8.so.0()(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_html-2.8.so.0(WXU_2.8)(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_stc-2.8.so.0()(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_stc-2.8.so.0(WXU_2.8)(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_xrc-2.8.so.0()(64bit) is needed by esl-erlang-21.0.5-1.x86_64
        libwx_gtk2u_xrc-2.8.so.0(WXU_2.8)(64bit) is needed by esl-erlang-21.0.5-1.x86_64

解决缺少的依赖包

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

再安装erlang

rpm -ivh esl-erlang_21.0.5-1~centos~6_amd64.rpm 
warning: esl-erlang_21.0.5-1~centos~6_amd64.rpm: Header V4 RSA/SHA1 Signature, key ID a14f4fca: NOKEY
Preparing...                ########################################### [100%]
   1:esl-erlang             ########################################### [100%]
Erlang OTP 21.0.5 installed

安装成功

五、安装rabbitmq

rpm -ivh rabbitmq-server-3.7.14-1.el6.noarch.rpm 
warning: rabbitmq-server-3.7.14-1.el6.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 6026dfca: NOKEY
error: Failed dependencies:
        erlang >= 20.3 is needed by rabbitmq-server-3.7.14-1.el6.noarch
        socat is needed by rabbitmq-server-3.7.14-1.el6.noarch

报错:erlang >= 20.3 需要安装erlang兼容包

    socat 安装socat包
wget https://raw.githubusercontent.com/jasonmcintosh/esl-erlang-compat/master/rpmbuild/RPMS/noarch/esl-erlang-compat-R14B-1.el6.noarch.rpm
wget http://repo.iotti.biz/CentOS/7/x86_64/socat-1.7.3.2-5.el7.lux.x86_64.rpm
rpm -ivh esl-erlang-compat-R14B-1.el6.noarch.rpm 
Preparing...                ########################################### [100%]
   1:esl-erlang-compat      ########################################### [100%]
 rpm -ivh socat-1.7.3.2-5.el7.lux.x86_64.rpm 
warning: socat-1.7.3.2-5.el7.lux.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 53e4e7a9: NOKEY
Preparing...                ########################################### [100%]
   1:socat                  ########################################### [100%]

再安装rabbitmq

rpm -ivh rabbitmq-server-3.7.14-1.el6.noarch.rpm 
warning: rabbitmq-server-3.7.14-1.el6.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 6026dfca: NOKEY
Preparing...                ########################################### [100%]
   1:rabbitmq-server        ########################################### [100%]

六、启动rabbitmq

rabbitmq-server start &
[1] 27890
[[email protected]_server src]# 
  ##  ##
  ##  ##      RabbitMQ 3.7.14. Copyright (C) 2007-2019 Pivotal Software, Inc.
  ##########  Licensed under the MPL.  See https://www.rabbitmq.com/
  ######  ##
  ##########  Logs: /var/log/rabbitmq/[email protected]_server.log
                    /var/log/rabbitmq/[email protected]_server_upgrade.log

              Starting broker...
 completed with 3 plugins.

七、查看5672端口

netstat -tunlp |grep 5672
tcp        0      0 0.0.0.0:25672               0.0.0.0:*                   LISTEN      28140/beam.smp      
tcp        0      0 0.0.0.0:15672               0.0.0.0:*                   LISTEN      28140/beam.smp      
tcp        0      0 :::5672                     :::*                        LISTEN      28140/beam.sm

八、安装管控台插件

rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node [email protected]_server:
rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to [email protected]_server...
Plugin configuration unchanged.

九、打开管控台

技术图片

十、增加一个管理员账号

[[email protected]_server src]# rabbitmqctl add_user admin Zaq1xsw
Adding user "admin" ...
[[email protected]_server src]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...

[[email protected]_server src]# rabbitmqctl set_permissions -p / admin ‘.*‘ ‘.*‘ ‘.*‘
Setting permissions for user "admin" in vhost "/" ...

 

十一、登录管控台

技术图片

 

 

以上是关于centos6安装rabbitmq的主要内容,如果未能解决你的问题,请参考以下文章

Centos6.9安装Rabbitmq

centos6.5 安装rabbitMQ3.6.6

centos6安装rabbitmq

centos6安装rabbitmq

CentOS6.5中配置Rabbitmq3.6.6集群方案

centos6.5安装rabbitmq3.6.14