rabbitmq centos7 安装操作

简单记录一下

  • 安装命令
  1. yum --enablerepo=epel -y install rabbitmq-server
  • centos7 防火墙,关闭一下,或者自行添加规则
  1. firewall-cmd --add-port=5672/tcp --permanent
  2. firewall-cmd --reload
  • 用户管理

    • 用户添加

      1. rabbitmqctl add_user username password
      2. rabbitmqctl list_users
    • 修改密码

      1. rabbitmqctl change_password username password2
    • 删除用户

      1. rabbitmqctl delete_user username
    • 添加权限
      1. rabbitmqctl set_user_tags username administrator
  • 管理vhost

    • 添加

      1. rabbitmqctl add_vhost /my_vhost
      2. rabbitmqctl list_vhosts
    • 删除

      1. rabbitmqctl delete_vhost /my_vhost
    • 设置vhost 对应用户权限

      1. rabbitmqctl set_permissions -p /my_vhost username ".*" ".*" ".*"
      2. rabbitmqctl list_permissions -p /my_vhost
      3. rabbitmqctl list_user_permissions username
      4. rabbitmqctl clear_permissions -p /my_vhost username
  • 启动
    • 启动
      1. rabbitmq-server
    • 进程启动
      1. rabbitmq-server -detached