RabbitMQ 常用命令

给centos安装epel yum 源

# rpm -ivh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
安装erlang运行环境
# yum install erlang
安装rabbitmq server
# rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
# rpm -ivh http://www.rabbitmq.com/releases/rabbitmq-server/v3.0.0/rabbitmq-server-3.0.0-1.noarch.rpm
打开server
# chkconfig rabbitmq-server on
# rabbitmqctl status
会报异常:

# rabbitmqctl status
Status of node rabbit@devnote ...
Error: unable to connect to node rabbit@devnote: nodedown

DIAGNOSTICS
===========

nodes in question: [rabbit@devnote]

hosts, their running nodes and ports:
- devnote: [{rabbitmqctl24923,51045}]

current node details:
- node name: rabbitmqctl24923@devnote
- home dir: /var/lib/rabbitmq
- cookie hash: TblHThacrBHJzl5Vt7Y4Ww==
执行命令:

# /sbin/service rabbitmq-server stop
# /sbin/service rabbitmq-server start
# rabbitmqctl status 测试正确

查看所有队列信息

# rabbitmqctl list_queues
关闭应用

# rabbitmqctl stop_app
启动应用,和上述关闭命令配合使用,达到清空队列的目的

# rabbitmqctl start_app
清除所有队列

# rabbitmqctl reset
更多用法及参数,可以执行如下命令查看

# rabbitmqctl

(1)首先关闭rabbitmq: rabbitmqctl stop_app

(2)还原: rabbitmqctl reset

(3)启动: rabbitmqctl start_app

(4)添加用户: rabbitmqctl add_user root root

(5)设置权限:rabbitmqctl set_permissions -p / root ".*" ".*" ".*"

(6)查看用户: rabbitmqctl list_users
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值