linux快速安装Rabbitmq

linux快速安装Rabbitmq

  1. 准备yum仓库

          # root执行
          rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
          rpm --import https://packagecloud.io/rabbitmq/erlang/gpgkey
          rpm --import https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
    
  2. 准备仓库文件

    shell 复制代码
    # root执行
    vim /etc/yum.repos.d/rabbitmq.repo
  3. 在rabbitmq.repo中填入如下内容

    shell 复制代码
    ##
    ## Zero dependency Erlang
    ##
    
    [rabbitmq_erlang]
    name=rabbitmq_erlang
    baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/$basearch
    repo_gpgcheck=1
    gpgcheck=1
    enabled=1
    # PackageCloud's repository key and RabbitMQ package signing key
    gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
           https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt
    metadata_expire=300
    
    [rabbitmq_erlang-source]
    name=rabbitmq_erlang-source
    baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/SRPMS
    repo_gpgcheck=1
    gpgcheck=0
    enabled=1
    # PackageCloud's repository key and RabbitMQ package signing key
    gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
           https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt
    metadata_expire=300
    
    ##
    ## RabbitMQ server
    ##
    
    [rabbitmq_server]
    name=rabbitmq_server
    baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/$basearch
    repo_gpgcheck=1
    gpgcheck=0
    enabled=1
    # PackageCloud's repository key and RabbitMQ package signing key
    gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
           https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt
    metadata_expire=300
    
    [rabbitmq_server-source]
    name=rabbitmq_server-source
    baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/7/SRPMS
    repo_gpgcheck=1
    gpgcheck=0
    enabled=1
    gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt
    metadata_expire=300
  4. 安装

    shell 复制代码
    # root执行
    yum -y install erlang rabbitmq-server
  5. 启动

    shell 复制代码
    # root执行
    # 使用systemctl管控,服务名:rabbitmq-server
    systemctl enable rabbitmq-server         # 开机自启
    systemctl disable rabbitmq-server        # 关闭开机自启
    systemctl start rabbitmq-server          # 启动
    systemctl stop rabbitmq-server           # 关闭
    systemctl status rabbitmq-server         # 查看状态
  6. 关闭防火墙

    shell 复制代码
    # 以下操作2选1即可
    # 方式1:关闭防火墙
    systemctl stop firewalld     #关闭防火墙
    systemctl disable firewalld  #停止防火墙开机自启
    
    # 方式2:放行5672、15672、25672端口的外部访问
    firewall-cmd --add-port=5672/tcp --permanent		# 放行tcp规则下的5672端口,永久生效
    firewall-cmd --add-port=15672/tcp --permanent		# 放行tcp规则下的15672端口,永久生效
    firewall-cmd --add-port=25672/tcp --permanent		# 放行tcp规则下的25672端口,永久生效
    firewall-cmd --reload								# 重新加载防火墙规则
  7. 启动RabbitMQ的WEB管理控制台

    rabbitmq-plugins enable rabbitmq_management
    
  8. 添加admin用户,并赋予权限

    shell 复制代码
    rabbitmqctl add_user admin 'admin'     # rabbitmqctl add_user admin 'admin用户的密码'
    rabbitmqctl set_permissions -p "/" "admin" ".*" ".*" ".*"
    rabbitmqctl set_user_tags admin administrator
  9. 浏览器打开管理控制台IP:15672

相关推荐
算法与编程之美28 分钟前
文件的写入与读取
linux·运维·服务器
xianwu5431 小时前
反向代理模块
linux·开发语言·网络·git
Amelio_Ming1 小时前
Permissions 0755 for ‘/etc/ssh/ssh_host_rsa_key‘ are too open.问题解决
linux·运维·ssh
Ven%2 小时前
centos查看硬盘资源使用情况命令大全
linux·运维·centos
TeYiToKu3 小时前
笔记整理—linux驱动开发部分(9)framebuffer驱动框架
linux·c语言·arm开发·驱动开发·笔记·嵌入式硬件·arm
dsywws3 小时前
Linux学习笔记之时间日期和查找和解压缩指令
linux·笔记·学习
yeyuningzi3 小时前
Debian 12环境里部署nginx步骤记录
linux·运维·服务器
上辈子杀猪这辈子学IT3 小时前
【Zookeeper集群搭建】安装zookeeper、zookeeper集群配置、zookeeper启动与关闭、zookeeper的shell命令操作
linux·hadoop·zookeeper·centos·debian
minihuabei3 小时前
linux centos 安装redis
linux·redis·centos
lldhsds4 小时前
书生大模型实战营第四期-入门岛-1. Linux前置基础
linux