Erlang 下载:
http://erlang.org/download/otp_win64_19.2.exe
http://erlang.org/download/otp_win32_19.2.exe
RabbitMQ 下载:
http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6.exe
先执行 otp_win64_19.2.exe, 再执行 rabbitmq-server-3.6.6.exe(RabbitMQ 服务自动添加并启动)
安装 rabbitmq-management 管理插件:
rabbitmq-management 管理插件提供一个基于 HTTP 接口的管理工具和监控工具。
> 声明 list 和 删除 exchanges, queues, bindings, users, virtual hosts 及 permissions.
> 监控 队列长度, 全局和通道的消息速率,每个连接的数据速率等
> 发送和接收消息
> 监控 Erlang 进程,文件描述符及内存使用情况
> 导入导出对象定义到 JSON
> 强制关闭连接,清空队列
Overview | Import / Export |
---|---|
Channel List | Queue Details |
启用管理插件(命令行执行):
> cd D:\Program Files\RabbitMQ Server\rabbitmq_server-3.6.6\sbin
> rabbitmq-plugins.bat enable rabbitmq_management
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management
Applying plugin configuration to rabbit@Itinside-89... started 6 plugins.
打开浏览器访问 http://localhost:15672/ ,用户:guest,密码:guest
安装命令行管理工具 rabbitmqadmin:
rabbitmqadmin介绍:
https://www.rabbitmq.com/management-cli.html
http://localhost:15672/cli/
rabbitmqadmin下载:
http://localhost:15672/cli/rabbitmqadmin
https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/rabbitmq_v3_6_6/bin/rabbitmqadmin
下载命名为 rabbitmqadmin ,可放到任意目录(如文件在目录:D:\Python34\rabbitmqadmin)
注:在python 2.7 和 python 3.4 能正常执行。
执行(打开命令行进入到文件目录,再执行):
cd D:\Python34
python.exe rabbitmqadmin --help
简单例子:
#查看 exchanges (端口为管理端口,默认为15672)
python rabbitmqadmin -P 12345 -V / list exchanges
python rabbitmqadmin -P 12345 -V / -u guest -p guest list exchanges
#查看 queues
python rabbitmqadmin -P 12345 list queues
python rabbitmqadmin -P 12345 -f long -d 3 list queues
D:\Python34>python rabbitmqadmin -P 12345 -V / list exchanges
+--------------------+---------+
| name | type |
+--------------------+---------+
| | direct |
| amq.direct | direct |
| amq.fanout | fanout |
| amq.headers | headers |
| amq.match | headers |
| amq.rabbitmq.log | topic |
| amq.rabbitmq.trace | topic |
| amq.topic | topic |
| test_direct | direct |
| test_fanout | fanout |
| test_topic | topic |
+--------------------+---------+
D:\Python34>python rabbitmqadmin -P 12345 list queues
+---------+----------+
| name | messages |
+---------+----------+
| queue00 | 0 |
| queue01 | 0 |
| queue02 | 0 |
| queue03 | 0 |
| queue04 | 0 |
| queue05 | 0 |
| queue06 | 0 |
+---------+----------+