Loading...
墨滴

Sqh

2021/05/03  阅读:47  主题:WeChat-Format

RabbitMQ的安装

2.2 RabbitMQ 的安装

2.2.1 下载

官网下载地址: https://www.rabbitmq.com/download.html![image-20190925220115235](RibbitMQ 实战教程.assets/image-20190925220115235.png)

最新版本: 3.7.18

2.2.2 下载的安装包![image-20190925220343521](RibbitMQ 实战教程.assets/image-20190925220343521.png)

注意:这里的安装包是centos7安装的包

2.2.3 安装步骤

# 1.将rabbitmq安装包上传到linux系统中
 erlang-22.0.7-1.el7.x86_64.rpm
 rabbitmq-server-3.7.18-1.el7.noarch.rpm

# 2.安装Erlang依赖包
 rpm -ivh erlang-22.0.7-1.el7.x86_64.rpm

# 3.安装RabbitMQ安装包(需要联网)
 yum install -y rabbitmq-server-3.7.18-1.el7.noarch.rpm
  注意:默认安装完成后配置文件模板在:/usr/share/doc/rabbitmq-server-3.7.18/rabbitmq.config.example目录中,需要 
    将配置文件复制到/etc/rabbitmq/目录中,并修改名称为rabbitmq.config
# 4.复制配置文件
 cp /usr/share/doc/rabbitmq-server-3.7.18/rabbitmq.config.example /etc/rabbitmq/rabbitmq.config

# 5.查看配置文件位置
 ls /etc/rabbitmq/rabbitmq.config

# 6.修改配置文件(参见下图:)
 vim /etc/rabbitmq/rabbitmq.config 

![image-20190925222230260](RibbitMQ 实战教程.assets/image-20190925222230260-3836271.png)

将上图中配置文件中红色部分去掉%%,以及最后的,逗号 修改为下图:

![image-20190925222329200](RibbitMQ 实战教程.assets/image-20190925222329200-3836312.png)

# 7.执行如下命令,启动rabbitmq中的插件管理
 rabbitmq-plugins enable rabbitmq_management
 
 出现如下说明:
  Enabling plugins on node rabbit@localhost:
    rabbitmq_management
    The following plugins have been configured:
      rabbitmq_management
      rabbitmq_management_agent
      rabbitmq_web_dispatch
    Applying plugin configuration to rabbit@localhost...
    The following plugins have been enabled:
      rabbitmq_management
      rabbitmq_management_agent
      rabbitmq_web_dispatch

    set 3 plugins.
    Offline change; changes will take effect at broker restart.

# 8.启动RabbitMQ的服务
 systemctl start rabbitmq-server
 systemctl restart rabbitmq-server
 systemctl stop rabbitmq-server
 

# 9.查看服务状态(见下图:)
 systemctl status rabbitmq-server
  ● rabbitmq-server.service - RabbitMQ broker
     Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; disabled; vendor preset: disabled)
     Active: active (running) since 三 2019-09-25 22:26:35 CST; 7s ago
   Main PID: 2904 (beam.smp)
     Status: "Initialized"
     CGroup: /system.slice/rabbitmq-server.service
             ├─2904 /usr/lib64/erlang/erts-10.4.4/bin/beam.smp -W w -A 64 -MBas ageffcbf -MHas ageffcbf -
             MBlmbcs...
             ├─3220 erl_child_setup 32768
             ├─3243 inet_gethost 4
             └─3244 inet_gethost 4
      .........

![image-20190925222743776](RibbitMQ 实战教程.assets/image-20190925222743776-3836511.png)

# 10.关闭防火墙服务
 systemctl disable firewalld
    Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
    Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
 systemctl stop firewalld   

# 11.访问web管理界面
 http://10.15.0.8:15672/

![image-20190926194738708](RibbitMQ 实战教程.assets/image-20190926194738708-3836601.png)

# 12.登录管理界面
 username:  guest
 password:  guest

![image-20190926194954822](RibbitMQ 实战教程.assets/image-20190926194954822-3836665.png)

Sqh

2021/05/03  阅读:47  主题:WeChat-Format

作者介绍

Sqh