准备工作
1 epel
下载阿里云的epel
cd /etc/yum.repos.d
rm -rf *
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
参考url https://developer.aliyun.com/mirror/epel?spm=a2c6h.13651102.0.0.3e221b11D5Krgh
2 查询最新的mq版本以及对应的erlang信息
参考url
https://www.rabbitmq.com/which-erlang.html
最新版本的mq为 3.8.12 对应的erlang为 23.X
配置yum源
参考 https://www.rabbitmq.com/install-rpm.html#package-cloud
A quick way to install is to use a Package Cloud-provided script. Package Cloud also can be used to install a recent Erlang version via yum.
1 参考 https://packagecloud.io/rabbitmq/rabbitmq-server/install#bash-rpm
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
# import the new PackageCloud key that will be used starting December 1st, 2018 (GMT)
rpm --import https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
# import the old PackageCloud key that will be discontinued on December 1st, 2018 (GMT)
rpm --import https://packagecloud.io/gpg.key
rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
centos7 建repo文件
cd /etc/yum.repos.d
vi bintray-rabbitmq-server.repo
[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.8.x/el/7/
gpgcheck=0
repo_gpgcheck=0
enabled=1
rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
# This example assumes the CentOS 8 version of the package.
# For CentOS 7, replace "el8" with "el7".
yum install rabbitmq-server -y
启动服务
说明:
### Start the Server
The server is not started as a daemon by default when the RabbitMQ server package is installed. To start the daemon by default when the system boots, as an administrator run
chkconfig rabbitmq-server on
As an administrator, start and stop the server as usual:
/sbin/service rabbitmq-server start
/sbin/service rabbitmq-server stop
centos7 可以使用systemctl命令
systemctl enable rabbitmq-server
systemctl start rabbitmq-server
安装完成
下一步就是配置rabbitmq