官网地址:
http://www.rabbitmq.com/install-debian.html
- 下载erlang等依赖包
# AErlang Solutions repository to obtain esl-erlang
wget -O- https://packages.erlang-solutions.com/debian/erlang_solutions.asc |
sudo apt-key add -echdeb https://packages.erlang-solutions.com/debian wheezy contrib' |
sudo tee /etc/apt/sources.list.d/esl.list
sudo apt-get update
sudo apt-get install init-system-helpers socat esl-erlang
2.下载deb Download the Server
采用 dpkg -i 进行安装
sudo dpkg -i rabbitmq-server_3.6.8-1_all.deb
3.安装 RabbitMQWeb管理插件
rabbitmq-plugins enable rabbitmq_management
service rabbitmq-server restart
打开浏览器登录:http://127.0.0.1:15672 55672也可以,直接跳转到下列web管理
登录 账号密码默认都是 guest
4.一些文件的路径
Config file /etc/rabbitmq/rabbitmq.config (not found)
Database directory /var/lib/rabbitmq/mnesia/rabbit@chenhanghang-ThinkPad-T460
Log file /var/log/rabbitmq/rabbit@chenhanghang-ThinkPad-T460.log
SASL log file /var/log/rabbitmq/rabbit@chenhanghang-ThinkPad-T460-sasl.log
5.启动RabbitMQ Server
/etc/init.d/rabbitmq-serverstart
或
service rabbitmq-service start
6.获取服务器信息
服务器状态:rabbitmqctl status
队列信息:rabbitmqctl list_queues[-p vhostpath] [queueinfoitem ...]
Queueinfoitem可以为:name,durable,auto_delete,arguments,messages_ready,
messages_unacknowledged,messages,consumers,memory
Exchange信息:rabbitmqctllist_exchanges[-p vhostpath] [exchangeinfoitem ...]
Exchangeinfoitem有:name,type,durable,auto_delete,internal,arguments.
Binding信息:rabbitmqctllist_bindings[-p vhostpath] [bindinginfoitem ...]
Bindinginfoitem有:source_name,source_kind,destination_name,destination_kind,routing_key,arguments
Connection信息:rabbitmqctllist_connections [connectioninfoitem ...]
Connectioninfoitem有:recv_oct,recv_cnt,send_oct,send_cnt,send_pend等。
Channel信息:rabbitmqctl list_channels[channelinfoitem ...]
Channelinfoitem有consumer_count,messages_unacknowledged,messages_uncommitted,acks_uncommitted,messages_unconfirmed,prefetch_count,client_flow_blocked
- 用户管理
新建用户:rabbitmqctl add_user xxxpwd
删除用户: rabbitmqctl delete_user xxx
改密码: rabbimqctl change_password {username} {newpassword}
设置用户角色:rabbitmqctl set_user_tags {username} {tag ...}
Tag可以为 administrator,monitoring, management
网友评论