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

相关推荐
F-2H几秒前
C语言:指针4(常量指针和指针常量及动态内存分配)
java·linux·c语言·开发语言·前端·c++
aherhuo3 分钟前
基于openEuler22.09部署OpenStack Yoga云平台(一)
linux·运维·服务器·openstack
檀越剑指大厂30 分钟前
【Linux系列】Shell 脚本中的条件判断:`[ ]`与`[[ ]]`的比较
linux·运维·服务器
2301_819287123 小时前
ce第六次作业
linux·运维·服务器·网络
武汉联从信息3 小时前
如何使用linux日志管理工具来管理oracle osb服务器日志文件?
linux·运维·服务器
Aileen_0v03 小时前
【AI驱动的数据结构:包装类的艺术与科学】
linux·数据结构·人工智能·笔记·网络协议·tcp/ip·whisper
小林想被监督学习4 小时前
RabbitMQ 的7种工作模式
分布式·rabbitmq
州周4 小时前
Ftp目录整个下载
linux·服务器·数据库
Jackey_Song_Odd4 小时前
Ubuntu 24.04.1 解决部分中文字符(门、径)显示错误的问题
linux·ubuntu
kaixin_learn_qt_ing4 小时前
Linux export命令
linux