RabbitMQ安装
-
下载Erlang的rpm包
RabbitMQ由Erlang语言编写,依赖Erang环境。
Erlang环境一定要与RabbitMQ版本匹配:https://www.rabbitmq.com/which-erlang.html
Erlang下载地址:https://github.com/rabbitmq/erlang-rpm/releases -
下载RabbitMQ的rpm包
RabbitMQ下载地址:https://www.rabbitmq.com/download.html -
下载socat的rpm包
Rabbitmq安装依赖于socat,需下载socat。socat下载地址:http://repo.iotti.biz/CentOS/6/x86_64/socat-1.7.3.2-1.el6.lux.x86_64.rpm
根据自身需求下载对应系统socat依赖:(http://repo.iotti.biz/CentOS/)
-
分别安装Erlang、Socat、RabbitMQ(一定按照顺序!)
rpm -ivh erlang-23.0.3-1.el7.x86_64.rpm
rpm -ivh socat-1.7.3.2-1.el6.lux.x86_64.rpm
rpm -ivh rabbitmq-server-3.8.5-1.el7.noarch.rpm
安装Socat也可以直接
yum install socat
- 安装管理插件:rabbitmq-plugins enable rabbitmq_management
rpm -qpl rabbitmq-server-3.8.5-1.el7.noarch.rpm
cd /usr/lib/rabbitmq/lib/rabbitmq_server-3.8.5/plugins
启用命令:
rabbitmq-plugins enable rabbitmq_management
安装后网页登录,默认端口15672,默认账号guest/guest,但是只允许本地登录,外连会拒绝
rabbitmqctl --help |grep user
创建账户guest2020
rabbitmqctl add_user guest2020 guest2020
授权
rabbitmqctl set_permissions -p / guest2020 ".*" ".*" ".*"
赋予角色
rabbitmqctl set_user_tags guest2020 administrator
测试登录