行业资讯 2025年08月6日
0 收藏 0 点赞 342 浏览 6776 个字
摘要 :

文章目录 一、概述 二、开始编排部署 EFAK 1)部署 docker 2)部署 docker-compose 3)创建自定义docker网络 4)创建 MySQL 挂载目录 5)编排 docker-compose.yaml 部……




  • 一、概述
  • 二、开始编排部署 EFAK
    • 1)部署 docker
    • 2)部署 docker-compose
    • 3)创建自定义docker网络
    • 4)创建 MySQL 挂载目录
    • 5)编排 docker-compose.yaml 部署

    本文主要讲解关于docker-compose 如何快速部署 EFAK 相关内容,让我们来一起学习下吧!

    一、概述

    EFAKEagle For Apache Kafka,以前称为 Kafka Eagle)是一款由国内公司开源的Kafka集群监控系统,可以用来监视kafka集群的broker状态、Topic信息、IO、内存、consumer线程、偏移量等信息,并进行可视化图表展示。独特的KQL还可以通过SQL在线查询kafka中的数据。docker-compose 如何快速部署 EFAK

    二、开始编排部署 EFAK

    1)部署 docker

    # 安装yum-config-manager配置工具
    yum -y install yum-utils
    
    # 建议使用阿里云yum源:(推荐)
    #yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    
    # 安装docker-ce版本
    yum install -y docker-ce
    # 启动并开机启动
    systemctl enable --now docker
    docker --version
    

    2)部署 docker-compose

    curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
    
    chmod +x /usr/local/bin/docker-compose
    docker-compose --version
    

    3)创建自定义docker网络

    # 创建
    docker network create bigdata
    
    # 查看
    docker network ls
    

    4)创建 MySQL 挂载目录

    mkdir -pv mysql/{data,logs}
    

    5)编排 docker-compose.yaml 部署

    docker-compose.yml

    services:
      zookeeper:
        image:  registry.cn-hangzhou.aliyuncs.com/bigdata_cloudnative/efak-zookeeper:3.8.1
        container_name: zookeeper
        restart: always
        environment:
          - ZOOKEEPER_CLIENT_PORT=2181
           # 必须开启 允许匿名登录
          - ALLOW_ANONYMOUS_LOGIN=yes
          - TZ=Asia/Shanghai
        volumes:
          - /etc/localtime:/etc/localtime
        ports:
          - 2181:2181
        networks:
          - bigdata
    
      kafka:
        image:  registry.cn-hangzhou.aliyuncs.com/bigdata_cloudnative/kafka:3.2.3
        container_name: kafka
        restart: always
        environment:
          - KAFKA_BROKER_ID=1
           # 内部访问
          - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092
           # 外部访问 由于有端口冲突 指定为190092
          - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://192.168.182.110:19092
          - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
          - ALLOW_PLAINTEXT_LISTENER=yes
           # 是否启用kafka Raft 模式 默认是yes 要给关闭
          - KAFKA_ENABLE_KRAFT=no
          - JMX_PORT=9999
          - TZ=Asia/Shanghai
        volumes:
          - /etc/localtime:/etc/localtime
        ports:
          - 19092:9092
          - 9999:9999
        depends_on:
          - zookeeper
        networks:
          - bigdata
    
    
      mysql-kafka:
        image: registry.cn-hangzhou.aliyuncs.com/bigdata_cloudnative/mysql:5.7
        container_name: mysql-kafka
        restart: always
        environment:
          - MYSQL_ROOT_PASSWORD=123456
          - MYSQL_DATABASE=ke
          - TZ=Asia/Shanghai
        volumes:
          - /etc/localtime:/etc/localtime
          - ./mysql/data:/var/lib/mysql
          - ./mysql/logs:/var/log/mysql
        networks:
          - bigdata
        ports:
          - 13306:3306
    
      eagle:
        image:  registry.cn-hangzhou.aliyuncs.com/bigdata_cloudnative/kafka-eagle:2.0.3
        container_name: eagle
        environment:
          - EFAK_CLUSTER_ZK_LIST=zookeeper:2181
           # 所有的做时间同步宿主机 要不然会有时间问题
          - TZ=Asia/Shanghai
        volumes:
          - /etc/localtime:/etc/localtime
          - ./system-config.properties:/kafka-eagle/conf/system-config.properties
        depends_on:
          - kafka
        ports:
          - 8048:8048
        networks:
          - bigdata
    
    
    networks:
      bigdata:
        driver: bridge
    

    配置文件system-config.properties

    # 指定zookeeper
    ######################################
    # multi zookeeper & kafka cluster list
    ######################################
    # kafka.eagle.zk.cluster.alias=cluster1,cluster2,cluster3
    kafka.eagle.zk.cluster.alias=cluster1
    cluster1.zk.list=zookeeper:2181
    
    ######################################
    # zookeeper enable acl
    ######################################
    cluster1.zk.acl.enable=false
    cluster1.zk.acl.schema=digest
    cluster1.zk.acl.username=test
    cluster1.zk.acl.password=test123
    
    ######################################
    # broker size online list
    ######################################
    cluster1.kafka.eagle.broker.size=10
    
    ######################################
    # zk client thread limit
    ######################################
    kafka.zk.limit.size=25
    
    ######################################
    # kafka eagle webui port
    ######################################
    kafka.eagle.webui.port=8048
    
    ######################################
    # kafka jmx acl and ssl authenticate
    ######################################
    cluster1.kafka.eagle.jmx.acl=false
    cluster1.kafka.eagle.jmx.user=keadmin
    cluster1.kafka.eagle.jmx.password=keadmin123
    cluster1.kafka.eagle.jmx.ssl=false
    cluster1.kafka.eagle.jmx.truststore.location=/Users/dengjie/workspace/ssl/certificates/kafka.truststore
    cluster1.kafka.eagle.jmx.truststore.password=ke123456
    
    ######################################
    # kafka offset storage
    ######################################
    cluster1.kafka.eagle.offset.storage=kafka
    cluster2.kafka.eagle.offset.storage=zookeeper
    
    ######################################
    # kafka metrics, 15 days by default
    ######################################
    kafka.eagle.metrics.charts=true
    kafka.eagle.metrics.retain=15
    
    ######################################
    # kafka sql topic records max
    ######################################
    kafka.eagle.sql.topic.records.max=5000
    
    ######################################
    # delete kafka topic token
    ######################################
    kafka.eagle.topic.token=keadmin
    
    ######################################
    # kafka sasl authenticate
    ######################################
    cluster1.kafka.eagle.sasl.enable=false
    cluster1.kafka.eagle.sasl.protocol=SASL_PLAINTEXT
    cluster1.kafka.eagle.sasl.mechanism=SCRAM-SHA-256
    cluster1.kafka.eagle.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username=\"kafka\" password=\"kafka-eagle\";
    cluster1.kafka.eagle.sasl.client.id=
    cluster1.kafka.eagle.blacklist.topics=
    cluster1.kafka.eagle.sasl.cgroup.enable=false
    cluster1.kafka.eagle.sasl.cgroup.topics=
    cluster2.kafka.eagle.sasl.enable=false
    cluster2.kafka.eagle.sasl.protocol=SASL_PLAINTEXT
    cluster2.kafka.eagle.sasl.mechanism=PLAIN
    cluster2.kafka.eagle.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username=\"kafka\" password=\"kafka-eagle\";
    cluster2.kafka.eagle.sasl.client.id=
    cluster2.kafka.eagle.blacklist.topics=
    cluster2.kafka.eagle.sasl.cgroup.enable=false
    cluster2.kafka.eagle.sasl.cgroup.topics=
    
    ######################################
    # kafka ssl authenticate
    ######################################
    cluster3.kafka.eagle.ssl.enable=false
    cluster3.kafka.eagle.ssl.protocol=SSL
    cluster3.kafka.eagle.ssl.truststore.location=
    cluster3.kafka.eagle.ssl.truststore.password=
    cluster3.kafka.eagle.ssl.keystore.location=
    cluster3.kafka.eagle.ssl.keystore.password=
    cluster3.kafka.eagle.ssl.key.password=
    cluster3.kafka.eagle.blacklist.topics=
    cluster3.kafka.eagle.ssl.cgroup.enable=false
    cluster3.kafka.eagle.ssl.cgroup.topics=
    
    # eagle 默认使用hadoop 存储信息
    ######################################
    # kafka sqlite jdbc driver address
    ######################################
    #kafka.eagle.driver=org.sqlite.JDBC
    #kafka.eagle.url=jdbc:sqlite:/hadoop/kafka-eagle/db/ke.db
    #kafka.eagle.username=root
    #kafka.eagle.password=www.kafka-eagle.org
    
    # 我们使用MySQL 进行数据存储
    ######################################
    # kafka mysql jdbc driver address
    ######################################
    kafka.eagle.driver=com.mysql.jdbc.Driver
    kafka.eagle.url=jdbc:mysql://192.168.182.110:13306/ke?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
    kafka.eagle.username=root
    kafka.eagle.password=123456
    

    启动服务

    docker-compose -f docker-compose.yml up -d
    

    访问:http://192.168.182.110:8048/,记得更换自己的地址哦!!!

    账号/密码:admin/123456

    也可以管理多套集群,通过修改EFAK配置文件重启即可。

    kafka.eagle.zk.cluster.alias=cluster1,cluster2,cluster3
    

    以上就是关于docker-compose 如何快速部署 EFAK相关的全部内容,希望对你有帮助哦。欢迎持续关注潘子夜个人博客(www.panziye.com),学习愉快哦!

微信扫一扫

支付宝扫一扫

版权: 转载请注明出处:https://www.zuozi.net/10067.html

管理员

相关推荐
2025-08-06

文章目录 一、Reader 接口概述 1.1 什么是 Reader 接口? 1.2 Reader 与 InputStream 的区别 1.3 …

988
2025-08-06

文章目录 一、事件溯源 (一)核心概念 (二)Kafka与Golang的优势 (三)完整代码实现 二、命令…

465
2025-08-06

文章目录 一、证明GC期间执行native函数的线程仍在运行 二、native线程操作Java对象的影响及处理方…

348
2025-08-06

文章目录 一、事务基础概念 二、MyBatis事务管理机制 (一)JDBC原生事务管理(JdbcTransaction)…

456
2025-08-06

文章目录 一、SnowFlake算法核心原理 二、SnowFlake算法工作流程详解 三、SnowFlake算法的Java代码…

517
2025-08-06

文章目录 一、本地Jar包的加载操作 二、本地Class的加载方法 三、远程Jar包的加载方式 你知道Groo…

832
发表评论
暂无评论

还没有评论呢,快来抢沙发~

助力内容变现

将您的收入提升到一个新的水平

点击联系客服

在线时间:08:00-23:00

客服QQ

122325244

客服电话

400-888-8888

客服邮箱

122325244@qq.com

扫描二维码

关注微信客服号