rabbirmq-docker-安装-基础
赋值配置文件到数据卷位置
docker cp -a 容器ID:/etc/rabbitmq /opt/software/rabbitMQ/conf
docker cp -a 容器ID:/var/lib/rabbitmq /opt/software/rabbitMQ/data
docker cp -a 容器ID:/var/log/rabbitmq /opt/software/rabbitMQ/log
docker run -d -p 5672:5672 \
-p 15672:15672 \
-e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=123 \
-v /opt/software/rabbitMQ/data:/var/lib/rabbitmq \
-v /opt/software/rabbitMQ/conf:/etc/rabbitmq \
-v /opt/software/rabbitMQ/log:/var/log/rabbitmq \
--name rabbitmq \
rabbitmq:management
状态查看:
rabbitmqctl status 查看状态
rabbitmqctl list_bindings 查看绑定
rabbitmqctl list_channels 查看channel
rabbitmqctl list_connectios 查看connectios
rabbitmqctl list_consumers 查看消费者
rabbitmqctl list_exchanges 查看交换机
队列相关:
rabbitmqctl list_queues 查看队列
rabbitmqctl delete_queue 队列名字 删除队列
rabbitmqctl purge_queue 队列名字 清空队列
用户相关:
rabbitmgctl add user 新建用户:
rabbitmqctl change_password 修改用户密码:
rabbitmgctl delete user 删除用户
rabbitmgctl list users 查看用户
rabbitmqctl rabbitmgctl set_user_tags 设置用户角色
1、创建账户和密码
rabbitmqctl add_user admin 123
2、设置用户权限
rabbitmqctl set_user_tags admin administrator
3、设置用户角色
rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
4、查看当前所有账户
rabbitmqctl list_users
应用启动:
rabbitmqctl start_app 启动应用
rabbitmqctl stop_app 关闭应用保留Erlang虚拟机(暂停)
rabbitmqctl stop 关闭应用并关闭Erlang虚拟机
集群相关:
rabbitmqctl join_cluster 加入集群
rabbitmqctl reset 离开集群
镜像队列:
rabbitmqctl sync_queue 设置镜像队列
rabbitmqctl cancel_sync_queue 取消镜像队列