Centos 7/8 安装Rabbit-MQ

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

1. 首先需要安装ErLang

# yum 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
# yum 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/7  # 如果是Centos8最后的数字修改为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
# yum 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 --now 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    .*    .*    .*

 

posted @ 2020-02-15 22:50  Vincen_shen  阅读(371)  评论(0编辑  收藏  举报