# 查看服务器的状态
rabbitmqctl status
# 查看环境变量
rabbitmqctl environment
# 停止rabbitmq的应用
rabbitmqctl stop_app
# 启动rabbitmq的应用
rabbitmqctl start_app
# 添加用户
rabbitmqctl add_user <username> <password>
rabbitmqctl add_user uplooking 123456
# 列出所有的用户
rabbitmqctl list_users
# 将用户设置为管理员用户
rabbitmqctl set_user_tags uplooking administrator
# 查看虚拟主机
rabbitmqctl list_vhosts
# 添加虚拟主机
rabbitmqctl add_vhost /uplooking
rabbitmqctl add_vhost /uplooking/ops
rabbitmqctl add_vhost /uplooking/java
# 删除虚拟主机
rabbitmqctl delete_vhost /uplooking/java
# 查看默认虚拟主机的权限
rabbitmqctl list_permissions
# 设置用户的权限,.* 表示分别对 组件的配置文件、读权限、写权限
rabbitmqctl set_permissions -p /uplooking uplooking ".*" ".*" ".*"
# 查看虚拟主机的权限
rabbitmqctl list_permissions -p /uplooking
# 组件查看
rabbitmqctl list_queues -p /uplooking