写在前面:
1.服务器centos 7.8.2003版本
2.安装erlang参考博文A:https://www.cnblogs.com/fengyumeng/p/11133924.html
3.安装rabbitmq参考博文B(仅做参考,具体搭建还是看文档):https://blog.csdn.net/jiang1986829/article/details/106090073
一、安装erlang
1.安装erlang完全用参考博文A,都能走完流程。(不再赘述)
二、安装rabbitmq
1.参考博文B,安装socat。
2.参考博文B,安装public signing key。
3.安装rabbitmq-server(可能会出现找不到镜像的问题,多执行几次直到成功即可)
yum install -y rabbitmq-server
4.替换配置文件,如下图所示
根据不同系统设置不同的配置文件,文件名称(rabbitmq_erlang.repo),配置文件内容如下:
[rabbitmq_erlang]
name=rabbitmq-rabbitmq-erlang
baseurl=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/7/$basearch
repo_gpgcheck=1
enabled=1
gpgkey=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key
https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
gpgcheck=1
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
pkg_gpgcheck=1
autorefresh=1
type=rpm-md
[rabbitmq_erlang-noarch]
name=rabbitmq-rabbitmq-erlang-noarch
baseurl=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/7/noarch
repo_gpgcheck=1
enabled=1
gpgkey=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key
https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
gpgcheck=1
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
pkg_gpgcheck=1
autorefresh=1
type=rpm-md
[rabbitmq_erlang-source]
name=rabbitmq-rabbitmq-erlang-source
baseurl=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/rpm/el/7/SRPMS
repo_gpgcheck=1
enabled=1
gpgkey=https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key
https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
gpgcheck=1
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
pkg_gpgcheck=1
autorefresh=1
type=rpm-md
[rabbitmq_server]
name=rabbitmq_server
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[rabbitmq_server-source]
name=rabbitmq_server-source
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
5.清除yum缓存
sudo yum clean all && sudo yum makecache
6.启动RabbitMQ服务
service rabbitmq-server start
7.状态查看
rabbitmqctl status
8.启用插件
rabbitmq-plugins enable rabbitmq_management
9.重启服务
service rabbitmq-server restart
10.添加帐号:name 密码:passwd
rabbitmqctl add_user name passwd
11.赋予其administrator角色
rabbitmqctl set_user_tags name administrator
12.设置权限(设置、读、写、操作)
rabbitmqctl set_permissions -p / name ".*" ".*" ".*"
13.其他操作命令参考博文B