RabbitMQ安装备忘录
目录
安装准备
安装RabbitMQ前需要安装Elang/OTP,并且版本关系
要对应
RabbitMQ官网:https://www.rabbitmq.com/
Elang/OTP官网:https://www.erlang.org/
Elang/OTP环境变量配置
添加系统变量:ERLANG_HOME
值:C:\Program Files\Erlang OTP
设置Path:%ERLANG_HOME%\bin
RabbitMQ环境变量配置
添加系统变量:RABBITMQ_SERVER 值:C:\Program Files\RabbitMQ Server\rabbitmq_server-[version]
设置Path:%RABBITMQ_SERVER%\sbin
启用安装管理插件
RabbitMQ安装完成后需要安装管理控制台,不然无法访问站点
如果配置了环境变量,直接运行:
rabbitmq-plugins enable rabbitmq_management
如果没有配置RabbitMQ的环境变量需要到RabbitMQ的安装目录sbin中执行命令:
rabbitmq-plugins.bat enable rabbitmq_management
配置对外开放端口
为了运行 RabbitMQ 并允许客户端连接,服务器需要开放以下端口:
5672(TCP):这是 RabbitMQ 的主要协议 AMQP 的默认端口。客户端通常通过这个端口与 RabbitMQ 通信。
15672(TCP):RabbitMQ 管理插件的 HTTP API 和管理控制台使用的端口。只有在启用管理插件时才需要开放。
正常来说开通 5672和15672两个就够了。
其他接口说明:
25672(TCP):RabbitMQ 节点间的通信端口,用于集群节点之间的互联。
4369(TCP):Erlang 分布式节点使用的端口,用于节点发现服务(EPMD)。
61613 和 61614(TCP):用于 STOMP 协议的端口,适用于 RabbitMQ 支持的消息传递协议。
1883 和 8883(TCP):用于 MQTT 协议的端口,如果 RabbitMQ 支持 MQTT 协议。
以上端口是默认配置,具体情况可能取决于服务器的防火墙设置和网络配置。
如果使用nginx反向代理端口,则5672端口需要在Stream中,而不是代理http协议
RabbitMQ与Elang/OTP的版本对应关系
RabbitMQ与Elang/OTP的版本对应关系:https://www.rabbitmq.com/docs/which-erlang#eol-series
RabbitMQ version | Minimum required Erlang/OTP | Maximum supported Erlang/OTP | Notes |
---|---|---|---|
3.13.7 3.13.6 3.13.5 3.13.4 3.13.3 3.13.2 3.13.1 3.13.0 | 26.0 | 26.2.x | The 3.13 release series is compatible with Erlang 26. OpenSSL 3 support in Erlang is considered to be mature and ready for production use. Erlang 26.1 and later versions supports FIPS mode on OpenSSL 3 |
3.12.13 3.12.12 3.12.11 3.12.10 | 25.0 | 26.2.x | The 3.12 release series is compatible with Erlang 26. OpenSSL 3 support in Erlang is considered to be mature enough for production. Erlang 26.1 and later versions supports FIPS mode on OpenSSL 3 |
3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 | 25.0 | 26.1.x | The 3.12 release series is compatible with Erlang 26. OpenSSL 3 support in Erlang is considered to be mature enough for production. Erlang 26.1 supports FIPS mode on OpenSSL 3 |
3.12.4 3.12.3 3.12.2 3.12.1 3.12.0 | 25.0 | 26.0.x | The 3.12 release series is compatible with Erlang 26. OpenSSL 3 support in Erlang is considered to be mature enough for production. |
3.11.28 3.11.27 3.11.26 3.11.25 3.11.24 3.11.23 3.11.22 3.11.21 3.11.20 3.11.19 3.11.18 3.11.17 3.11.16 3.11.15 3.11.14 3.11.13 3.11.12 3.11.11 3.11.10 3.11.9 3.11.8 3.11.7 3.11.6 3.11.5 3.11.4 3.11.3 3.11.2 3.11.1 3.11.0 | 25.0 | 25.3.x | Erlang 26 is supported starting with RabbitMQ 3.12.0. As of Erlang 25.1, OpenSSL 3.0 support in Erlang is considered to be mature enough for production. Erlang 25 before 25.0.2 is affected by CVE-2022-37026, a CVE with critical severity (CVSS 3.x Base Score: 9.8) |
Elang/OTP与windows版本对应关系
Elang/OTP安装有windows版本要求
下面是 Erlang/OTP 版本与 Windows Server 版本的支持关系表格
Erlang/OTP 版本 | Windows Server 支持版本 | 备注 |
---|---|---|
Erlang/OTP 24.x | Windows Server 2012, 2016, 2019, 2022 | 支持较旧的版本,包括 Windows Server 2012(RabbitMQ) |
Erlang/OTP 25.x | Windows Server 2016, 2019, 2022 | |
Erlang/OTP 26.x | Windows Server 2016, 2019, 2022 | 不支持 Windows Server 2012(Erlang.org)(RabbitMQ) |
Erlang/OTP 27.x | Windows Server 2016, 2019, 2022 | 仅支持较新的 Windows Server 版本(Erlang.org) |
问题
无法访问15672
安装后如果无法访问RabbitMQ的控制台,检查RabbitMQ与ELang的版本,如果版本没问题,再确定Elang/OTP是否正确安装。
控制台运行命令erl,如果正常返回版本号,代表正确,如果报错,检查Elang/OTP与服务器系统版本是否一致
运行后意外终止:
RabbitMQ服务运行后一小段时间就自动停止,通过查看系统日志可以看到错误消息:
RabbitMQ: Erlang machine stopped instantly (distribution name conflict?). The service is not restarted, ignoring OnFail option.
可能是重装RabbitMQ引起的:
删除目录:%AppData%\RabbitMQ
中的所有文件,问题得到解决
Windows Server 2012服务器上安装
ErLang/OTP版本为:24.3.4.17
RabbitMQ版本为:3.10.25