RabbitMQ Server的安装、配置及常用命令
首先需要安装Erlang环境:
http://www.rabbitmq.com/server.html
下载RabbitMQ Server的windows安装包并安装到D盘下:
http://www.rabbitmq.com/server.html
在CMD命令行下运行上面的rabbitmq server程序:
D:\rabbitmq\sbin>rabbitmq-server
这样rabbitmq server就运行起来了。
常用命令:
添加创建虚拟主机:
D:\rabbitmq\sbin>rabbitmqctl add_vhost dnt_mq //注:删除虚拟主机 rabbitmqctl delete_vhost vhostpath
显示出所有虚拟主机信息:
D:\rabbitmq\sbin>rabbitmqctl list_vhosts
添加用户和密码(用户名daizhj, 密码:617595):
D:\rabbitmq\sbin>rabbitmqctl add_user daizhj 617595 //注:修改用户密码:rabbitmqctl change_password username newpassword
绑定用户权限:
D:\rabbitmq\sbin>rabbitmqctl set_permissions -p dnt_mq daizhj ".*" ".*" ".*"
列出用户权限:
D:\rabbitmq\sbin>rabbitmqctl list_user_permissions daizhj //注:清除用户权限 rabbitmqctl clear_permissions [-p vhostpath] username
查看所有队列信息:
rabbitmqctl list_queues
关闭应用:
rabbitmqctl stop_app
启动应用:
rabbitmqctl start_app
清除所有队列(清除队列之前要先关闭应用):
rabbitmqctl reset
列出指定queue的信息:
rabbitmqctl list_queues [the queue name] messages_ready messages_unacknowledged
列出所有exchange:
rabbitmqctl list_exchanges
列出所有binding:
rabbitmqctl list_bindings
参考:http://www.cnblogs.com/daizhj/archive/2010/10/21/1857374.html