美文网首页
Centos7 安装RabbitMQ

Centos7 安装RabbitMQ

作者: 隔岸坐看云卷云舒 | 来源:发表于2019-03-22 10:20 被阅读0次

    首先安装基础依赖

        yum install -y socat
    
        yum install erlang
    
    image

    Erlang 安装完毕后 配置Linux环境变量

        vim /etc/profile
    
        export ERLANG_HOME=/usr/local/lib/erlang
    
        export PATH=$PATH:$ERLANG_HOME/bin
    
        source /etc/profile
    

    然后从RabbmitMQ官网下载安装包

    image
    wget  https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.13/rabbitmq-server-3.7.13-1.el7.noarch.rpm
    

    下载完毕后执行命令

        rpm -ivh rabbitmq-server-3.7.13-1.el7.noarch.rpm
    
    image

    最后启动RabbmitMQ

        chkconfig rabbitmq-server on 
    
        /sbin/service rabbitmq-server start
    

    启用UI界面:

    rabbitmq-plugins enable rabbitmq_management
    

    创建用户

    [root@localhost ~]# rabbitmqctl add_user shumingjian 227227
    Adding user "shumingjian" ...
    
    

    将其设置为管理员

    [root@localhost ~]# rabbitmqctl set_user_tags shumingjian  administrator
    Setting tags for user "shumingjian" to [administrator] ...
    
    

    创建一个虚拟主机

    rabbitmqctl add_vhost  vhost_name
    

    打开管理后台
    you_ip:15672

    此刻,应该如图:


    WechatIMG477.jpeg

    常见问题:
    如果你的erlang版本达不到rabbitMQ的要求版本,请执行

    yum -y remove erlang* 
    
    #在/etc/yum.repos.d/rabbitmq-erlang.repo 
    [rabbitmq-erlang] 
    name = rabbitmq-erlang
     baseurl = https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/ 7
     gpgcheck = 1
     gpgkey = https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
     repo_gpgcheck = 0
     enabled = 1
    
    yum install erlang
    

    相关文章

      网友评论

          本文标题:Centos7 安装RabbitMQ

          本文链接:https://www.haomeiwen.com/subject/cmshvqtx.html