下载包

# 主程序
wget --content-disposition https://packagecloud.io/rabbitmq/rabbitmq-server/packages/el/7/rabbitmq-server-3.9.16-1.el7.noarch.rpm/download.rpm
# 依赖包
wget --content-disposition https://packagecloud.io/rabbitmq/erlang/packages/el/7/erlang-23.3.4.11-1.el7.x86_64.rpm/download.rpm
# 延迟插件
wget https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases/download/3.9.0/rabbitmq_delayed_message_exchange-3.9.0.ez

安装

rpm -ivh erlang-23.3.4.11-1.el7.x86_64.rpm
rpm -ivh rabbitmq-server-3.9.16-1.el7.noarch.rpm

启动

systemctl enable --now rabbitmq-server

开启Web管理插件

# 开启插件
rabbitmq-plugins enable rabbitmq_management
# 添加用户
# 说明:rabbitmq有一个默认的guest用户,但只能通过localhost访问,所以需要添加一个能够 远程访问的用户。
rabbitmqctl add_user [账号] [密码]
# 为用户分配操作权限
rabbitmqctl set_user_tags [用户] administrator
# 为用户分配资源权限
rabbitmqctl set_permissions -p / [用户] “.*” “.*” “.*”

访问web界面

访问地址:http://ip:15672

安装延迟插件

# 将插件拷贝到插件目录 
cp rabbitmq_delayed_message_exchange-3.9.0.ez /usr/lib/rabbitmq/lib/rabbitmq_server-3.9.6/plugins
# Enabling the Plugin应用插件
rabbitmq-plugins enable rabbitmq_delayed_message_exchange
# 查看安装的插件
rabbitmq-plugins list

星霜荏苒 居诸不息