Centos 8 安装Rabbit-MQ

rareli 2020-02-15

参考文档:https://www.rabbitmq.com/install-rpm.htm

1. 首先需要安装ErLang

# dnf install -y wget epel-release
# wget https://github.com/rabbitmq/erlang-rpm/releases/download/v21.3.8.6/erlang-21.3.8.6-1.el7.x86_64.rpm
# dnf install -y erlang-21.3.8.6-1.el7.x86_64.rpm

2. 添加RabbitMQ仓库

# vim /etc/yum.repos.d/rabbitmq.repo
[bintray-rabbitmq-server]
name=bintray-rabbitmq-rpm
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.8.x/el/8/
gpgcheck=0
repo_gpgcheck=0
enabled=1

3. 安装RabbitMQ Server

# rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
# dnf install -y rabbitmq-server# rpm -qi rabbitmq-server

4. 开放端口

# firewall-cmd --zone=public --add-port={5671,5672,15672}/tcp --permanent
# firewall-cmd --reload

5. 启动服务

# systemctl enable rabbitmq-server.service# systemctl start rabbitmq-server.service# rabbitmq-plugins enable rabbitmq_management  # 开启管理界面

6. 创建账号并授权

# rabbitmqctl add_user admin admin
# rabbitmqctl set_user_tags admin administrator
# rabbitmqctl set_permissions admin ".*" ".*" ".*"

# rabbitmqctl list_users
Listing users ...
user    tags
admin    [administrator]
guest    [administrator]

# rabbitmqctl list_permissions
Listing permissions for vhost "/" ...
user    configure    write    read
guest    .*    .*    .*
admin    .*    .*    .*

相关推荐