Skip to the content.

清除队列 步骤

步骤

rabbitmqctl stop_app # 首先关闭rabbitmq
rabbitmqctl reset # 还原
rabbitmqctl start_app # 启动
rabbitmqctl add_user root root # 添加用户
rabbitmqctl set_permissions -p / root ".*" ".*" ".*" # 设置权限
rabbitmqctl list_users # 查看用户
rabbitmqctl set_user_tags root administrator # set tag 
# [shell]
rabbitmqctl stop_app
rabbitmqctl reset
rabbitmqctl start_app
rabbitmqctl add_user root root
rabbitmqctl set_permissions -p / root ".*" ".*" ".*"
rabbitmqctl set_user_tags root administrator
rabbitmqctl list_users

其他命令

rabbitmqctl status # 节点状态
rabbitmqctl add_user username password # 添加用户
rabbitmqctl list_users # 列出所有用户
rabbitmqctl list_user_permissions username # 列出用户权限
rabbitmqctl change_password username newpassword # 修改密码
rabbitmqctl add_vhost vhostpath # 创建虚拟主机
rabbitmqctl list_vhosts # 列出所有虚拟主机
rabbitmqctl set_permissions -p vhostpath username ".*" ".*" ".*" # 设置用户权限
rabbitmqctl list_permissions -p vhostpath # 列出虚拟主机上的所有权限 
rabbitmqctl clear_permissions -p vhostpath username # 清除用户权限
rabbitmqctl -p vhostpath purge_queue blue # 清除队列里的消息
rabbitmqctl delete_user username # 删除用户
rabbitmqctl delete_vhost vhostpath # 删除虚拟主机