rpm包有系统版本要求,el是Red Hat Enterprise Linux(EL)的缩写。
EL7是Red Hat 7.x,Centos 7.x
EL8是Red Hat 8.x, Centos 8.x
所以我们在安装erlang及rabbitmq时需要选择与自己的服务器相对应的rpm包
# rabbitmq的rpm安装包
https://github.com/rabbitmq/rabbitmq-server/releases?page=10
# erlang的rpm安装包
https://github.com/rabbitmq/erlang-rpm/releases?page=6
# erlang及rabbitmq版本对应关系
https://www.rabbitmq.com/which-erlang.html
1、查看系统版本
2、下载安装包
sudo wget https://github.com/rabbitmq/erlang-rpm/releases/download/v23.3.4.11/erlang-23.3.4.11-1.el7.x86_64.rpm
sudo wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.9.16/rabbitmq-server-3.9.16-1.el7.noarch.rpm
3、安装erlang
sudo rpm -ivh erlang-23.3.4.11-1.el7.x86_64.rpm
yum install -y erlang
# 查看erlang版本 erl -version
yum install -y socat
4、安装rabbitmq
sudo rpm -ivh rabbitmq-server-3.9.16-1.el7.noarch.rpm
yum install rabbitmq-server -y
5、配置防火墙允许的端口
6、设置授权账号和密码,给予超级管理员角色
rabbitmqctl add_user admin admin
rabbitmqctl set_user_tags admin administrator
7、设置rabbitmq图像化界面
rabbitmq-plugins enable rabbitmq_management
8、测试连接
启动rabbitmq报错{"init terminating in do_boot",{error,{asn1,{"no such file or directory","asn1.app"}}}}
解决方法:
清理之前安装的erlang及rabbiemq,并重新安装
yum remove -y rabbitmq-server erlang erlang-*
rm -rf /usr/lib64/erlang
rm -rf /var/lib/rabbitmq