RabbitMQ在CentOS 7上的安装

1. 安装Erlang

1.1 在命令行执行以下命令

curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash

1.2 安装Erlang

yum install -y erlang

2. 安装RabbitMQ

2.1 添加包含RabbitMQ的yum repo

vim /etc/yum.repo.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

2.2 导入RabbitMQ的signing key

rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc

2.3 安装RabbitMQ

yum install -y rabbitmq-server

3. 验证RabbitMQ安装成功

3.1启动RabbitMQ

/sbin/service rabbitmq-server start

如果出现以下报错信息:
ERROR: epmd error for host centos7-kwz-12345678: address (cannot connect to host/port)


Snip20190428_1.png

3.2 解决方案:

vim /etc/hosts

把主机名centos7-kwz-12345678添加进hosts文件。

127.0.0.1 centos7-kwz-12345678

4. 设置自启动

chkconfig rabbitmq-server on

5. 验证

6. 参考链接:

www.rabbitmq.com
packagecloud.io/rabbitmq/erlang/install

你可能感兴趣的:(RabbitMQ在CentOS 7上的安装)