官网安装方式:https://github.com/rabbitmq/erlang-rpm
注意系统版本以及erlang和rabbitmq版本的对应关系即可,官网说明比较详细
一、我的系统为Centos7.*
Note that Erlang/OTP 22 is supported by RabbitMQ starting with version 3.7.15.
Package Cloud supports a variety of options for RPM package installation: from Yum configuration to shell scripts to Chef and Puppet.
See Package Cloud repository installation page for details.
To use the most recent version on CentOS 7:
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
二、安装erlang
yum install erlang
三、下载rabbitmq或者命令行下载
https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.7.15
wget https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.7.15/rabbitmq-server-3.7.15-1.el7.noarch.rpm
四、获取证书
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
五、安装RabbitMQ
yum install rabbitmq-server-3.7.15-1.el7.noarch.rpm
六、设置开机启动
chkconfig rabbitmq-server on
七、增加配置,你要在/etc/honsts中设置你的主机名我的叫(eureka1)
vim /etc/rabbitmq/rabbitmq-env.conf
NODENAME=rabbitmq@eureka1
八、启动、停止、状态查询、参数查询RabbitMQ
/sbin/service rabbitmq-server start
/sbin/service rabbitmq-server stop
/sbin/service rabbitmq-server status
rabbitmqctl status
九、RabbitMQ Web管理界面安装
rabbitmq-plugins enable rabbitmq_management
十、设置RabbitMQ远程ip登录
这里我们以创建个***(自己想象)**帐号,密码***(自己想象)**为例,创建一个账号并支持远程ip访问。
1.创建账号
rabbitmqctl add_user 用户名 密码
2.设置用户角色
rabbitmqctl set_user_tags 用户名 administrator
3.设置用户权限
rabbitmqctl set_permissions -p "/" 用户名 ".*" ".*" ".*"
4.设置完成后可以查看当前用户和角色(需要开启服务)
rabbitmqctl list_users
5.浏览器输入:serverip:15672。其中serverip是RabbitMQ-Server所在主机的ip。
6.如果发现访问不了,检查防火墙是否关闭,或者开发该端口
systemctl stop firewalld.service
systemctl disable firewalld.service