实验环境
- 虚拟主机一台
- 系统:Centos7
- 关闭防火墙
- 关闭selinux
- 保障网络的通常
实验开始
第一步:配置 repo 源
这次安装使用 yum 安装 rabbitmq,所以我们的配置一下 yum 源,为了使用 Yum 存储库,必须在 /etc/yum.repos.d/ 目录下添加一个 .repo 文件(例如rabbitmq.repo)。
# In /etc/yum.repos.d/rabbitmq.repo
##
## Zero dependency Erlang
##
[rabbitmq_erlang]
name=rabbitmq_erlang
baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
# PackageCloud's repository key and RabbitMQ package signing key
gpgkey=https://packagecloud.io/rabbitmq/erlang/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_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
##
## RabbitMQ server
##
[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
更新 yum 源
yum -y update
安装 Erlang 环境
因为 rabbitmq 是使用 Erlang 语言开发的,所以说 rabbitmq 是在 Erlang 环境上运行的。
yum -y install erlang
安装 rabbitmq 及依赖
yum -y install socat logrotate initscripts rabbitmq-server
现在已经可以启动 rabbitmq 正常的使用了,先在就是没有图形化界面管理。
启动服务器
chkconfig rabbitmq-server on
开启UI模式
配置文件名称为:rabbit.app
像管理员启动 rabbitmq
重启方法一
## 开启rabbitmq
systemctl start rabbitmq-server
## 停止rabbimq
systemctl stop rabbitmq-server
## 重启rabbitmq
systemctl restart rabbitmq_server
重启方法二
## 启动 rabbitmq
service rabbitmq-server start
## 停止 rabbitmq
service rabbitmq-server stop
## 重启 rabbitmq
service rabbitmq-server restart
UI界面登入
登入前的界面
登入后的界面