03.RabbitMQ安装启动
想要安装RabbitMQ,必须先安装erlang语言环境,类似安装tomcat,必须先安装JDK查看匹配的版本:https://www.rabbitmq.com/which-erlang.html
1.RabbitMQ安装启动
-
erlang下载:https://dl.bintray.com/rabbitmq-erlang/rpm/erlang
-
socat下载:http://repo.iotti.biz/CentOS/7/x86_64/socat-1.7.3.2-5.el7.lux.x86_64.rpm
-
RabbitMQ下载:https://www.rabbitmq.com/install-rpm.html#downloads
2. 安装
-
root@localhost opt]# rpm -ivh erlang-21.3.8.16-1.el7.x86_64.rpm
-
[root@localhost opt]# rpm -ivh socat-1.7.3.2-5.el7.lux.x86_64.rpm
-
[root@localhost opt]# rpm -ivh rabbitmq-server-3.8.6-1.el7.noarch.rpm
3. 启动后台管理插件
[root@localhost opt]# rabbitmq-plugins enable rabbitmq_management
4. 启动RabbitMQ
要把防火墙关闭才能访问管理平台
-
启动:[root@localhost opt]# systemctl start rabbitmq-server.service
-
[root@localhostopt]#systemctl status rabbitmq-server.service
-
[root@localhostopt]#systemctl restart rabbitmq-server.service
-
[root@localhost opt]# systemctl stop rabbitmq-server.service
5. 查看进程
[root@localhost opt]# ps -ef | grep rabbitmq
6. 测试
-
关闭防火墙: systemctl stop firewalld
-
浏览器输入:http://ip:15672
-
默认帐号密码:guest,guest用户默认不允许远程连接
(1)创建账号:
[root@localhost opt]# rabbitmqctl add_user jack 123456
(2)设置用户角色:
[root@localhost opt]# rabbitmqctl set_user_tags jack administrator
(3)设置用户权限
[root@localhostopt]# rabbitmqctl set_permissions -p “/” jack “." ".” “.*”
(4)查看当前用户和角色
[root@localhost opt]# rabbitmqctl list_users
(5)修改密码
[root@localhost opt]# rabbitmqctl change_password jack 123123
管理界面介绍
-
overview:概览
-
connections:查看链接情况
-
channels:信道(通道)情况
-
Exchanges:交换机(路由)情况,默认4类7个
-
Queues:消息队列情况
-
Admin:管理员列表
端口:
-
5672:RabbitMQ提供给编程语言客户端链接的端口
-
15672:RabbitMQ管理界面的端口
-
25672:RabbitMQ集群的端口