步骤
一、单机部署
1、下载erlang和rabbitmq安装包
2、安装rabbitmq
(1)进入安装目录
(2)安装erlang
rpm -ivh erlang-19.0.4-1.el7.centos.x86_64.rpm
(3)安装rabbitmq-server
yum install rabbitmq-server-3.6.6-1.el7.noarch.rpm
3、启动rabbitmq
service rabbitmq-server start
4、检查rabbit状态
rabbitmqctl -q status
5、设置用户名、密码,并加到管理组
rabbitmqctl add_user admin admin123
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
这里的admin是用户名,admin123是密码
安装过程结束。
补充:
1、添加exchange
rabbitmqctl eval 'rabbit_exchange:declare({resource, <<"/">>, exchange, <<"sse_exchange">>}, fanout, true, false, false, []).'
2、查看exchange
rabbitmqctl list_exchanges
3、停止:service rabbitmq-server stop
4、修改密码: rabbitmqctl change_password 用户名 新密码