首先 安装Erlang(RabittMQ 依赖ErLang 而且版本)
1.安装依赖:
sudo yum install -y gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git
2.安装yum源
创建yum源 参考:(https://github.com/rabbitmq/erlang-rpm)
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版本 和 centos版本 建议直接去github参考
3.安装
sudo yum install -y erlang
4.检查
进入erlang命令行表示成功
erl
5.安装 socat
yum install-y socat
6. RabbitMQ 安装(版本号 参考github https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.7.7)
下载: wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.7/rabbitmq-server-3.7.7-1.el6.noarch.rpm
安装: rpm -Uvh rabbitmq-server-3.7.7-1.el6.noarch.rpm
7.systemctl 操作 RabbitMQ服务:
systemctl start rabbitmq-server
systemctl status rabbitmq-server
systemctl restart rabbitmq-server
#设置为开机启动systemctl enable rabbitmq-server
8. 添加管理配置插件
#安装web管理页面插件(先启动rabbitmq服务):
rabbitmq-plugins enable rabbitmq_management
#开放端口
sudo firewall-cmd --add-port=15672/tcp --permanent
#重新加载防火墙配置
sudo firewall-cmd --reload