RabbitMq installation, command management, managment interface management (a)

    RabbitMqs of the installation do not want to say, say it to say cocoon came. Speaking from his own experience to it!

    (A): after a successful installation can be seen in the browser follows the login page, enter the address bar http: // localhost: 15672 /, Username : guest Password: guest, you can log in using a guest account. Remember RabbitMq exhausted after a day in the service turned off the next day with the time to open
Here Insert Picture Description
(b) management:

    管理RabbitMQ有4中方式:
	RabbitMQ Management(Web UI)
	rabbitmqctl
	command line tool(curl)(不说了,有时间在研究)
	rabbitmqadmin(不说了,有时间在研究)	

    There may be a single physical machine erlang plurality of nodes (Example), each node can run multiple applications, which have important applications RabbitMQ, the Erlang comes Mnesia language database, and the associated plug RabbitMQ (e.g., Management RabbitMQ ). Erlang node can be analogous to the java JVM.
Here Insert Picture Description
(1) rabbitmqctl command mode:
    RabbitMQ RabbitMQ Management is a management interface for operation, can operate many common operations, but does not support all the operations, command line support all features.
Enter the appropriate command cmd in RabbitMq directory sbin:
Here Insert Picture Description
rabbitmqctl command line: Command line is more powerful than the web management interface, web interface command only a subset of commands rabbitmqctl

应用程序和集群管理(Application and Cluster Management)、
集群配置(Cluster management)、
用户管理(User management)、
访问控制(Access Control)、
参数管理(Parameter Management)、
政策管理(Policy Management)、
服务器状态(Server Status)
Miscellaneous

rabbitmqctl command line:


rabbitmq-server // 同时启动erlang节点和应用程序

// 查看rabrabbitmqctl所支持的命令
rabrabbitmqctl

//查看所有RabbitMq命令
rabbitmqctl list_help

// 查看状态
rabbitmqctl status

//停止erlang node,同时关闭erlang节点和应用程序
rabbitmqctl stop  

// 停止RabbitMQ服务,仅关闭erlang节点上的rabbit应用程序
rabbitmqctl stop_app 

// 启动RabbitMQ服务
rabbitmqctl start_app 

// 格式化rabbitmq node(在集群中需要满足一定的条件才能关闭)
//首先运行rabbitmqctl stop_app 服务停了才能reset
rabbitmqctl reset

// 强制格式化rabbitmq node
rabbitmqctl force_reset

// 清除某个队列的所有消息
rabbitmqctl purge_queue <name>

// 添加用户
rabbitmqctl add_user <username> <password>

// 设置权限
rabbitmqctl set_permissions -p / <username> ".*" ".*" ".*"

// 列举权限
rabbitmqctl list_permissions -p <vhost>

// 列举用户的所有权限
rabbitmqctl list_user_permissions <username>

// 清除权限
rabbitmqctl clear_permissions -p <vhost> <username>

// 认证用户
rabbitmqctl authenticate_user <username> <password>

// 修改密码
rabbitmqctl change_password <username> <password>

// 列举用户
rabbitmqctl list_users

// 删除用户(删除用户时也会把用户相关的权限都删除)
rabbitmqctl delete_user <username>

// 设置tag, tag可以为none最小权限角色,management 管理员角色,policymaker决策者,monitoring 监控,administrator  超级管理员 
rabbitmqctl set_user_tags <username> <tag>

// 添加虚拟主机
rabbitmqctl add_vhost <name> 

// 删除虚拟主机
rabbitmqctl delete_vhost <name> 

// 查看所有虚拟主机
rabbitmqctl list_vhost [<vhostinfoitem> ...]

// 列举默认虚拟机上的所有队列
rabbitmqctl list_queues

// 列出指定虚拟机上的队列
rabbitmqctl list_queues -p <vhost>

// 列举队列,包含队列名称、消息数目、消费者数目、内存使用情况、是否持久化、是否自动删除
rabbitmqctl list_queues name messages counsumers memory durable auto_delete

// 查看交换机
rabbitmqctl list_exchanges [name] [type] [durable] [auto_delete]

// 列举所有绑定
rabbitmqctl list_bindings [-p <vhost>]

(2) RabbitMq Managment Interface Management:

    If you enter http: // localhost: 15672 / pages might get out of the service did not open, enter the command in the sbin open service

Reference: https: //blog.csdn.net/zheng911209/article/details/49949303

After you've created your page symbol explanation:

1: D and AD
Here Insert Picture Description

声明(创建)队列  b:durable是否持久化, 队列的声明默认是存放到内存中的,如果true :rabbitmq重启队列不会丢失但是里面消息没了 false:队列和消息全没了
//b1:exclusive:是否排外的,有两个作用,一:当连接关闭时connection.close()该队列是否会自动删除
//b2:autoDelete:是否自动删除,当最后一个消费者断开连接之后队列是否自动被删除,当consumers = 0时队列就会自动删除        
channel.queueDeclare(QUEUE_NAME,true,false,false,null);

The first representative of a boolean parameter durable queue is persistent. FIG derived from durable D

FIG appeared above D, D AD may also appear on the inside, on behalf b2: autoDelete second boolean argument is true when

2: How to create several consumers to view
Here Insert Picture Description
3: How to create your own view of the switch
Here Insert Picture Description
4: how to view the queue of messages in the consumer line chart
Here Insert Picture Description
Here Insert Picture Description

Published 168 original articles · won praise 10 · views 10000 +

Guess you like

Origin blog.csdn.net/weixin_41987908/article/details/104274760