CentOS7下RabbitMQ3.7安装与配置
一、前言
本篇文章适用范围RabbitMQ 3.7+ CentOS 7环境信息
CentOS 7.X Erlang 20.2(RabbitMQ要求是19.3-20.2.x) RabbitMQ 3.7.x
二、RabbitMQ安装
1、 首先需要安装Erlang(19.3+),这里采用yum安装方式- 安装准备
#创建yum源 sudo vi /etc/yum.repos.d/rabbitmq-erlang.repo #文件内容 [rabbitmq-erlang] name=rabbitmq-erlang baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/7 gpgcheck=1 gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc repo_gpgcheck=0 enabled=1
- Erlang安装
#安装 sudo yum install -y erlang #验证 #进入erlang命令行表示成功 erl2、 安装 socat
sudo yum install -y socat
3、 RPM安装rabbitmq
官网下载地址:https://www.rabbitmq.com/install-rpm.html
# 安装 sudo rpm -Uvh https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.5/rabbitmq-server-3.7.5-1.el7.noarch.rpm #如果遇到erlang已安装且版本正确,但是RabbitMQ检测失败的情况 #可以追加参数 —nodeps (不验证软件包依赖)3、 启动RabbitMQ服务
#启动服务 sudo systemctl start rabbitmq-server #查看状态 sudo systemctl status rabbitmq-server #设置为开机启动 sudo systemctl enable rabbitmq-server
三、rabbitmq配置
添加用户#添加用户 sudo rabbitmqctl add_user admin pwd #设置用户角色 sudo rabbitmqctl set_user_tags admin administrator #tag(administrator,monitoring,policymaker,management) #设置用户权限(接受来自所有Host的所有操作) sudo rabbitmqctl set_permissions -p "/" admin '.*' '.*' '.*' #查看用户权限 sudo rabbitmqctl list_user_permissions admin配置远程访问
#启动rabbitmq内置web插件, 管理rabbitmq账号等信息 rabbitmq-plugins enable rabbitmq_management重启服务
sudo systemctl restart rabbitmq-server
四、 延时插件安装
# 进入默认安装的插件目录 cd /usr/lib/rabbitmq/lib/rabbitmq_server-3.7.5/plugins/ # 下载延时插件 wget https://dl.bintray.com/rabbitmq/community-plugins/3.7.x/rabbitmq_delayed_message_exchange/rabbitmq_delayed_message_exchange-20171201-3.7.x.zip # 解压插件 unzip rabbitmq_delayed_message_exchange-20171201-3.7.x.zip # 启动插件 rabbitmq-plugins enable rabbitmq_delayed_message_exchange
相关推荐
liym 2020-07-20
changecan 2020-11-19
sunnnyduan 2020-10-16
lonesomer 2020-09-17
houdaiye 2020-09-23
XPZ0 2020-09-22
changecan 2020-09-22
jackadmi 2020-09-11
yuan00yu 2020-08-24
yserver 2020-08-15
liyansring 2020-08-15
liai 2020-08-09
山有木兮卿有意 2020-08-03
85206633 2020-07-28
suosuo 2020-07-28
83911930 2020-07-28
85590296 2020-07-22