一、安装Erlang

# 创建/etc/yum.repos.d/erlang.repo
touch /etc/yum.repos.d/erlang.repo 
# /etc/yum.repos.d/erlang.repo文件中添加如下内容
[erlang-solutions]
name=CentOS $releasever - $basearch - Erlang Solutions
baseurl=https://packages.erlang-solutions.com/rpm/centos/$releasever/$basearch
gpgcheck=1
gpgkey=https://packages.erlang-solutions.com/rpm/erlang_solutions.asc
enabled=1
yum install erlang -y

二、安装RabbitMQ Server

rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
# 创建/etc/yum.repos.d/rabbitmq.repo
touch /etc/yum.repos.d/rabbitmq.repo
# 在/etc/yum.repos.d/rabbitmq.repo文件中添加如下内容
[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/7/
gpgcheck=0
repo_gpgcheck=0
enabled=1
yum install rabbitmq-server -y

三、启动RabbitMQ Server

touch /etc/rabbitmq/rabbitmq-env.conf
# 在/etc/rabbitmq/rabbitmq-env.conf文件中添加如下内容
NODENAME=rabbit@localhost
# 让RabbitMQ server以守护进程的方式开机自启
systemctl enable rabbitmq-server
# 启动RabbitMQ server
systemctl start rabbitmq-server
# 停止RabbitMQ server
systemctl stop rabbitmq-server
# 查看RabbitMQ server启动状态
systemctl status rabbitmq-server