安装epel源
yum install -y epel-release.noarch
yum clean all && yum makecache fast && yum repolist enabled
安装依赖包
yum install -y erlang xmlto wget
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.3/rabbitmq-server-3.5.3-1.noarch.rpm -O /opt/rabbitmq-server-3.5.3-1.noarch.rpm
rpm -ivh /opt/rabbitmq-server-3.5.3-1.noarch.rpm
/etc/init.d/rabbitmq-server restart
rpm安装路径/usr/lib/rabbitmq
日志路径/var/log/rabbitmq/
命令路径/usr/sbin/
rabbitmq-plugins enable rabbitmq_management
ip:15672
使用rabbitmqctl add_user创建的用户登录,建议删除guest用户
主机名 | ip |
---|---|
node1 | 192.168.100.14 |
node2 | 192.168.100.76 |
node3 | 192.168.100.157 |
同单节点安装3个单节点的rabbitmq
yum install -y epel-release.noarch
yum clean all && yum makecache fast && yum repolist enabled
yum install -y erlang xmlto wget yum install -y erlang xmlto wget
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.3/rabbitmq-server-3.5.3-1.noarch.rpm -O /opt/rabbitmq-server-3.5.3-1.noarch.rpm
rpm -ivh /opt/rabbitmq-server-3.5.3-1.noarch.rpm
/etc/init.d/rabbitmq-server restart
使用监控页面
rabbitmq-plugins enable rabbitmq_management
ip:15672
使用rabbitmqctl add_user创建的用户登录,建议删除guest用户
/etc/init.d/rabbitmq-server stop
将node1上的.erlang.cookie传输到node2、node3,并保证权限一直
scp /var/lib/rabbitmq/.erlang.cookie node2:/var/lib/rabbitmq/
scp /var/lib/rabbitmq/.erlang.cookie node3:/var/lib/rabbitmq/
/etc/init.d/rabbitmq-server start
/etc/init.d/rabbitmq-server restart
rabbitmqctl stop
rabbitmq-server -detached
查看状态
rabbitmqctl cluster_status
关闭应用(不关闭节点)
rabbitmqctl stop_app
将节点加入到
rabbitmqctl join_cluster --disk rabbit@node1
查看状态
rabbitmqctl cluster_status
使用监控页面
rabbitmq-plugins enable rabbitmq_management
node1ip:15672
使用rabbitmqctl add_user创建的用户登录,建议删除guest用户
启动关闭节点
/etc/init.d/rabbitmq-server start
/etc/init.d/rabbitmq-server stop
/etc/init.d/rabbitmq-server restart
rabbitmq-server –detached
rabbitmqctl stop
启动关闭应用
rabbitmqctl stop_app
rabbitmqctl start_app
重置节点
重置前需要先关闭节点
rabbitmqctl stop
rabbitmqctl reset
rabbitmqctl force_reset
节点状态
rabbitmqctl cluster_status
查看所有信息队列
rabbitmqctl list_queues
队列信息
rabbitmqctl list_queues[-p vhostpath] [queueinfoitem ...]
查看交换信息
rabbitmqctl list_exchanges
查看绑定信息
rabbitmqctl list_bindings
添加用户
rabbitmqctl add_user username password
删除用户
rabbitmqctl delete_user username
改密码
rabbimqctlchange_password username newpassword
设置用户角色
rabbitmqctlset_user_tags {username} {tag ...}
Tag可以为 administrator,monitoring, management
默认配置文件没有创建
官方配置文档:http://www.rabbitmq.com/configure.html
原文地址:http://blog.51cto.com/13323775/2121471