1、安装 erlang
#以下地址中找到源
https://github.com/rabbitmq/erlang-rpm
#编辑文件:vim /etc/yum.repos.d/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
#更新源
yum clean all
yum makecache
#安装
yum install erlang
#出现版本冲突解决办法
rpm -e --nodeps `rpm -qa | grep R16B-03.18.el7.x86_64`
2、下载安装
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.15/rabbitmq-server-generic-unix-3.7.15.tar.xz
xz -d rabbitmq-server-generic-unix-3.7.15.tar.xz
tar -xvf rabbitmq-server-generic-unix-3.7.15.tar
3、修改端口
vim sbin/rabbitmq-env
#修改内容
DEFAULT_NODE_PORT=6000
4、开启网页管理
./sbin/rabbitmq-plugins enable rabbitmq_management
5、增加登录用户
./sbin/rabbitmqctl add_user admin admin
./sbin/rabbitmqctl set_user_tags admin administrator
6、启动服务
./sbin/rabbitmq-server start &
7、docker 方式
# 拉取镜像
docker pull daocloud.io/library/rabbitmq:3.7.12-management
# 运行镜像
docker run --name rabbitmq -p "5672:5672" -p "15672:15672" -d daocloud.io/library/rabbitmq:3.7.12-management
8、docker-compose 方式
version: "3"
services:
rabbitmq:
image: daocloud.io/library/rabbitmq:3.7.12-management
ports:
- "5672:5672"
- "15672:15672"
container_name: rabbitmq