CentOS7安装RabbitMQ3.7
安装Erlang
rabbit mq依赖于erlang,所以需要先安装erlang,并且rabbit mq不同版本对erlang的版本要求也不一样。
这里使用rabbit mq提供的erlang的包进行安装erlang
添加镜像
vim /etc/yum.repos.d/rabbitmq_erlang.repo
[rabbitmq_erlang]
name=rabbitmq_erlang
baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[rabbitmq_erlang-source]
name=rabbitmq_erlang-source
baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
安装yum install erlang
验证是否安装成功[[email protected] ~]$ erl
安装rabbit mq
下载rpmwget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.14/rabbitmq-server-3.7.14-1.el7.noarch.rpm
导入密钥
rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
安装yum install rabbitmq-server-3.7.14-1.el7.noarch.rpm
备注:如果这里安装失败,根据提示使用wget将依赖包socat下载到本地,然后使用rpm -ivh进行手动安装即可
启动
设置守护进程,系统启动时执行systemctl enable rabbitmq-server
启动systemctl start rabbitmq-server
停止systemctl stop rabbitmq-server
安装管理界面
启用rabbitmq_managementrabbitmq-plugins enable rabbitmq_management
重启rabbit mq/sbin/service rabbitmq-server restart
查看http服务开启,端口15672rabbitmqctl status | grep listeners
创建用户及授权
查看已经存在的用户rabbitmqctl list_users
新建用户rabbitmqctl add_user admin admin
授权rabbitmqctl set_user_tags admin administrator
原文地址:https://blog.51cto.com/mpflinux/2451450