1、先安装Erlang语言
1.1 配置 yum
vi /etc/yum.repos.d/rabbitmq_erlang.repo
将下面内容添加到 rabbitmq_erlang.repo 文件中。
[rabbitmq_erlang]
name=rabbitmq_erlang
baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[rabbitmq_erlang-source]
name=rabbitmq_erlang-source
baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
1.2 安装
yum install -y erlang
1.3 验证是否安装成功
注意:下面命令可能提示不存在,不过没有关系,我们可以直接去安装 RabbitMQ。
erl -version
2、安装RabbitMQ 3.8.2 以 rpm 方式
2.1 导入密钥
rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
2.2 下载 rpm 安装包
cd /otp/
mkdir RabbitMQ
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.2/rabbitmq-server-3.8.2-1.el7.noarch.rpm
2.3 安装
yum install rabbitmq-server-3.8.2-1.el7.noarch.rpm