首页 > 系统相关 >centos7安装Rabbitmq

centos7安装Rabbitmq

时间:2022-12-23 16:11:06浏览次数:148  
标签:... root rabbitmq server centos7 systemctl Rabbitmq junjian 安装

centos7安装Rabbitmq

  • 下载

    erlang-23.2.7-2.el7.x86_64.rpm下载地址

    RabbitMQ 3.8.30 下载地址 选择Assetsrabbitmq-server-3.8.30-1.el7.noarch.rpmmyDai64w

  • 下载完成后,将下载的包上传至服务器

    yum localinstall erlang-23.2.7-2.el7.x86_64.rpm #本地安装erlang
    erl -v 
    # 退出 Eshell 方法 按 Ctrl + g 然后 输入 q 按 Enter
    yum localinstall rabbitmq-server-3.8.30-1.el7.noarch.rpm #本地安装rabbitmq
    
    # 启动rabbitmq
    systemctl start rabbitmq-server
    # 查看rabbitmq状态
    systemctl status rabbitmq-server
    # 设置rabbitmq服务开机自启动
    systemctl enable rabbitmq-server
    # 关闭rabbitmq服务
    systemctl stop rabbitmq-server
    # 重启rabbitmq服务
    systemctl restart rabbitmq-server
    

    systemctl start rabbitmq-server然后 systemctl status rabbitmq-server 看到 Active: active (running)即代表启动成功

  • 如果出现执行systemctl start rabbitmq-server卡住或报如下错误

    Job for rabbitmq-server.service failed because the control process exited with error code. See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details.

    解决RabbitMQ启动报错

    [root@junjian rabbitmq]# hostname # 查看主机名
    junjian.com
    [root@junjian rabbitmq]# hostnamectl set-hostname junjian # 设置主机名
    [root@junjian rabbitmq]# hostname
    junjian
    [root@junjian rabbitmq]# ifconfig # 查看ip
    ...
    ens33: ...
            inet 192.168.159.11 ...
            ...
    ...
    [root@junjian rabbitmq]# vim /etc/hosts
    # 末尾添加
    # 192.168.159.11 junjian
    [root@junjian rabbitmq]# systemctl start rabbitmq-server
    [root@junjian rabbitmq]# systemctl status rabbitmq-server
       ...
       Active: active (running) ...
       ...
    

标签:...,root,rabbitmq,server,centos7,systemctl,Rabbitmq,junjian,安装
From: https://www.cnblogs.com/Zzzyyw/p/17000909.html

相关文章