一.windows安装
1. erlang环境
https://erlang.org/download/otp_versions_tree.html
配置环境变量
2. RabbitMQ下载
https://rabbitmq.com/install-windows.html#installer
3. RabbitMQ安装
cd D:\soft\RabbitMQ Server\rabbitmq_server-3.10.5\sbin
rabbitmq-plugins enable rabbitmq_management
二. linux安装
1.下载erlang
https://github.com/rabbitmq/erlang-rpm/releases
2.下载RabbitMQ
https://github.com/rabbitmq/rabbitmq-server/releases
3.安装erlang
rpm -ivh erlang-23.3.4.8-1.el7.x86_64.rpm
4.安装RabbitMQ
rpm -ivh rabbitmq-server-3.10.5-1.el8.noarch.rpm
5.启动插件管理
rabbitmq-plugins enable rabbitmq_management
6.管理命令
#启动服务
systemctl start rabbitmq-server
#重启服务
systemctl restart rabbitmq-server
#停止服务
systemctl stop rabbitmq-server
三.基本使用
1.默认端口
15672
管理平台的端口号
5672
AMQP协议端口
2.用户
默认用户guset
不能远程登录
AMQP连接报错
Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
管理平台报错
User can only log in via localhost
新建用户admin
命令行创建用户
#查看用户
rabbitmqctl list_users
#新建用户
rabbitmqctl add_user admin admin
#设置用户角色
rabbitmqctl set_user_tags admin administrator
#设置用户权限(设置admin用户拥有对所有资源的读写配置权限)
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"