CentOS7安装RabbitMQ

环境:虚拟机镜像安装CentOS-7-x86_64-DVD-1511.iso

Linux升级命令有两个分别是yum upgrade和yum update, 这个两个命令是有区别的:
yum -y update  升级所有包同时也升级软件和系统内核
yum -y upgrade 升级所有包不升级升级软件和系统内核
第一步、将数据源更换为阿里云软件源

1.下载数据源

下载到root目录下

wget http://mirrors.aliyun.com/repo/Centos-7.repo

2.备份数据源

/etc/yum.repos.d/目录下

备份文件为/etc/yum.repos.d/CentOS-Base.repo.bak

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

 3.复制新数据源

cp /root/Centos-7.repo /etc/yum.repos.d/

mv /etc/um.repos.d/Centos-7.repo /etc/um.repos.d/Centos-Base.repo

4.更新数据源

yum clean all

yum makecache

yum -y update

第二步、安装erlang

安装erlang依赖

yum update

yum install epel-release

下载rpm包

wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm

从erlang-solutions中更新该包,并将erlang_solutions.repo添加到/etc/yum.repos.d

rpm -Uvh erlang-solutions-1.0-1.noarch.rpm

安装

yum install erlang

运行以下命令以验证是否已安装Erlang。

erl

2、安装rabbitmq-server

首先安装依赖socat

yum install -y socat

下载rabbitmq-server

wget https://zysd-shanghai.oss-cn-shanghai.aliyuncs.com/software/linux/rabbitmq/rabbitmq-server-3.7.8-1.el7.noarch.rpm

安装

rpm -ivh rabbitmq-server-3.7.8-1.el7.noarch.rpm

3、设置

设置开机启动

chkconfig rabbitmq-server on

启动rabbitmq节点

service rabbitmq-server start

 

启用管理后台

rabbitmq-plugins enable rabbitmq_management

添加用户

rabbitmqctl add_user test 123456

配置用户权限

rabbitmqctl set_user_tags test administrator

rabbitmqctl set_permissions -p "/" test ".*" ".*" ".*"

配置防火墙

 

 

 #firewall-cmd --zone=public --add-port=15672/tcp --permanent

 #firewall-cmd --zone=public --add-port=5671-5672/tcp --permanent

 #firewall-cmd --zone=public --add-port=4369/tcp --permanent

 #firewall-cmd --zone=public --add-port=25672/tcp --permanent

 #firewall-cmd --zone=public --add-port=35672-35682/tcp --permanent

 #firewall-cmd --reload

访问管理后台访问(ip:15672)

http://192.168.xx.xx:15672/#/

关闭rabbitmq节点

service rabbitmq-server stop

 

参考:

https://cloud.tencent.com/developer/article/1447179

https://blog.csdn.net/y_k_y/article/details/81350274

https://www.helloweba.net/server/624.html

https://baijiahao.baidu.com/s?id=1650592184855967976&wfr=spider&for=pc

 

 

 

  1. wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
  2.  
posted @ 2020-02-08 01:02  xiaodangshan  阅读(1621)  评论(0编辑  收藏  举报