CentOS安装RabbitMQ

下载安装包

wget http://www.rabbitmq.com/releases/erlang/erlang-19.0.4-1.el7.centos.x86_64.rpm

wget https://dl.bintray.com/rabbitmq/rabbitmq-server-rpm/rabbitmq-server-3.6.13-1.el7.noarch.rpm

安装

rpm -ivh erlang-19.0.4-1.el7.centos.x86_64.rpm

yum install rabbitmq-server-3.6.13-1.el7.noarch.rpm

启动并验证启动情况

rabbitmq-server --detached & ps aux | grep rabbitmq

启用维护插件

rabbitmq-plugins enable rabbitmq_management

查看端口是否打开

netstat -anp | grep 5672
netstat -anp | grep 15672

firewall-cmd --list-all
firewall-cmd --add-port=5672/tcp
firewall-cmd --add-port=15672/tcp

服务的启动关闭

启动

service rabbitmq-server start

关闭

service rabbitmq-server stop

重启

service rabbitmq-server restart

用户管理

# 新增 
rabbitmqctl add_user admin admin
# 删除 
rabbitmqctl delete_user admin
# 修改 
rabbitmqctl change_password admin admin123
# 用户列表 
rabbitmqctl  list_users
# 设置角色 
rabbitmqctl set_user_tags admin administrator monitoring policymaker management
# 设置用户权限 
rabbitmqctl  set_permissions  -p  VHostPath  admin  ConfP  WriteP  ReadP
# 查询所有权限 
rabbitmqctl  list_permissions  [-p  VHostPath]
# 指定用户权限 
rabbitmqctl  list_user_permissions  admin
# 清除用户权限 
rabbitmqctl  clear_permissions  [-p VHostPath]  admin

你可能感兴趣的:(linux)