Centos7 搭建Rabbit MQ

安装rabbit mq 必须要先下载 Erlang

一、先更新下yum库

  1. yum update
  2. yum install epel-release
  3. yum install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git wget wxBase.x86_64

二、安装 Erlang

  1. wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
  2. rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
  3. yum update
  4. yum install erlang
  5. 验证是否安装成功,输入命令:erl

三、安装 RabbitMQ

通过weget 或 去官网下载rpm包 Rabbit mq官方下载地址
Rabbit 官网rpm下载地址没有最新的包,直接去上面的下载地址下rpm包

  1. wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.7.15/rabbitmq-server-3.7.15-1.el7.noarch.rpm
  2. rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
  3. yum install rabbitmq-server-3.7.15-1.el7.noarch.rpm

四、Rabbit MQ 启动并设置 后台

启动RabbitMQ

/sbin/service rabbitmq-server start

开机自动启动

systemctl enable rabbitmq-server

创建用户admin

rabbitmqctl add_user admin admin

给用户admin授权

rabbitmqctl  set_permissions -p "/" admin '.*' '.*' '.*'

给用户admin赋予administrator角色

rabbitmqctl set_user_tags admin administrator 

开启RabbitMQ控制台

rabbitmq-plugins enable rabbitmq_management

五、开放的端口

添加端口
firewall-cmd -–add-port=15672/tcp -–permanent
firewall-cmd -–add-port=5672/tcp -–permanent
重载入添加的端口:
firewall-cmd -–reload
查询指定端口是否开启成功:
firewall-cmd -–query-port=15672/tcp
firewall-cmd -–query-port=5672/tcp
Centos7 搭建Rabbit MQ_第1张图片
至此,rabbit MQ 搭建成功!

你可能感兴趣的:(杂记)