美文网首页Linux
Linux下安装rabbitMq

Linux下安装rabbitMq

作者: 試毅_思伟 | 来源:发表于2019-03-07 09:26 被阅读0次

    Linux下安装rabbitMq

    必须有Erlang环境------>>>Linux下安装Erlang

    一、安装rabbitMq
    # cd /usr/local/
    # yum install -y xz
    # wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.2/rabbitmq-server-generic-unix-3.6.2.tar.xz
    # xz -d rabbitmq-server-generic-unix-3.6.2.tar.xz
    # tar -xvf rabbitmq-server-generic-unix-3.6.2.tar
    --配置rabbitMq环境变量
    # vim /etc/profile
    文件末尾添加 export PATH=$PATH:/usr/local/rabbitmq_server-3.6.2/sbin
    # source /etc/profile
    

    二、配置网页插件
    # rabbitmq-plugins enable rabbitmq_management
    --启动rabbitMq
    # rabbitmq-server –detached
    Tips:rabbitmq默认会创建guest账号,只能用于localhost登录页面管理员
    --添加admin用户并且密码为admin
    # rabbitmqctl add_user admin admin
    --授权admin用户为管理员
    # rabbitmqctl set_user_tags admin administrator
    --授权访问权限
    # rabbitmqctl set_permissions -p "/" admin "." "." ".*"
    

    三、验证rabbitMq是否安装成功

    四、rabbitMq常用命令:
    • 启动:rabbitmq-server –detached
    • 查看服务状态:rabbitmqctl status
    • 关闭服务:rabbitmqctl stop
    • 查看所有用户:rabbitmqctl list_users
    • 添加用户:rabbitmqctl add_user admin admin
    • 授权用户管理员:rabbitmqctl set_user_tags admin administrator
    • 授权访问权限:rabbitmqctl set_permissions -p "/" admin "." "." ".*"
    • 添加虚拟机:rabbitmqctl add_vhost admin_vhost
    • 授权用户到虚拟机:rabbitmqctl set_permissions -p admin_vhost admin ".*" ".*" ".*"
    Tips:RabbitMQ与Erlang的版本对应关系图

    相关文章

      网友评论

        本文标题:Linux下安装rabbitMq

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