{"id":15032333,"url":"https://github.com/smartloli/efak","last_synced_at":"2026-01-12T06:47:25.232Z","repository":{"id":37107554,"uuid":"80907025","full_name":"smartloli/EFAK","owner":"smartloli","description":"A easy and high-performance monitoring system, for comprehensive monitoring and management of kafka cluster.","archived":false,"fork":false,"pushed_at":"2024-08-08T02:57:18.000Z","size":126095,"stargazers_count":3113,"open_issues_count":209,"forks_count":777,"subscribers_count":100,"default_branch":"main","last_synced_at":"2025-04-11T10:17:34.540Z","etag":null,"topics":["consumer-group","kafka","kafka-eagle","kafka-sql","ksql","offsets","zookeeper"],"latest_commit_sha":null,"homepage":"https://www.kafka-eagle.org/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartloli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-04T08:52:23.000Z","updated_at":"2025-04-11T08:54:00.000Z","dependencies_parsed_at":"2023-02-05T05:01:40.330Z","dependency_job_id":"f74f9453-423d-4dcc-9ac6-64ad1b4ea663","html_url":"https://github.com/smartloli/EFAK","commit_stats":null,"previous_names":["smartloli/kafka-eagle"],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartloli%2FEFAK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartloli%2FEFAK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartloli%2FEFAK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartloli%2FEFAK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartloli","download_url":"https://codeload.github.com/smartloli/EFAK/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249206,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["consumer-group","kafka","kafka-eagle","kafka-sql","ksql","offsets","zookeeper"],"created_at":"2024-09-24T20:18:03.753Z","updated_at":"2026-01-12T06:47:25.227Z","avatar_url":"https://github.com/smartloli.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EFAK-AI (Eagle For Apache Kafka - AI Enhanced)\n\n[![Version](https://img.shields.io/badge/version-5.0.0-blue.svg)](https://github.com/smartloli/EFAK)\n[![Java](https://img.shields.io/badge/Java-17-orange.svg)](https://openjdk.java.net/projects/jdk/17/)\n[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.4.5-green.svg)](https://spring.io/projects/spring-boot)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)\n\n[![Stargazers over time](https://starchart.cc/smartloli/EFAK.svg?variant=adaptive)](https://starchart.cc/smartloli/EFAK)\n\n## 项目简介\n\n**EFAK-AI (Eagle For Apache Kafka - AI)** 是一款开源的 Kafka 智能监控与管理平台，融合了人工智能技术，为 Kafka 运维提供智能化、可视化、自动化的全方位解决方案。\n\n### 🎯 核心优势\n\n- **🧠 AI 驱动**: 集成主流大语言模型（OpenAI、Claude、DeepSeek 等），提供智能对话式运维\n- **📊 实时监控**: 全方位监控 Kafka 集群健康状态、性能指标、消费延迟等关键数据\n- **🚀 高性能**: 基于 Spring Boot 3.x 和 JDK 17，采用响应式编程和异步处理\n- **🔧 易部署**: 支持 Docker 一键部署和传统 tar.gz 安装包两种方式\n\n## 核心特性\n\n### 🤖 AI 智能助手\n- **多模型支持**: 集成 OpenAI、Claude、DeepSeek 等多种大语言模型\n- **Function Calling**: AI 可自动调用后端函数查询实时数据\n- **图表自动生成**: 根据时序数据自动生成可视化图表\n- **Kafka 专家**: 专业的 Kafka 集群分析、性能优化和故障诊断建议\n- **流式对话**: 基于 SSE 的实时流式响应，体验更流畅\n- **Markdown 渲染**: 支持代码高亮、表格、Mermaid 图表等丰富格式\n- **对话历史**: 完整的会话管理和历史记录功能\n\n### 📊 集群监控\n- **实时监控**: Broker 节点状态、主题分区、消费者组监控\n- **性能指标**: 吞吐量、延迟、存储容量等关键指标\n- **历史数据**: 长期趋势分析和性能对比\n- **多集群支持**: 同时管理多个 Kafka 集群\n\n### ⚡ 分布式任务调度\n- **智能分片**: 基于 Redis 的分布式任务分片执行\n- **故障转移**: 自动检测节点故障并重新分配任务\n- **负载均衡**: 动态调整任务分配，优化资源利用\n- **单节点优化**: 自动检测单节点环境，跳过分片逻辑\n\n### 🚨 告警管理\n- **多渠道告警**: 支持钉钉、微信、飞书等多种告警渠道\n- **智能阈值**: 基于历史数据的动态阈值调整\n- **告警聚合**: 避免告警风暴，提供告警聚合和降噪\n- **可视化配置**: 直观的告警规则配置界面\n\n## 技术架构\n\n### 模块结构\n```\nEFAK-AI/\n├── efak-ai/          # 告警功能模块\n├── efak-core/        # 核心功能模块 (Kafka 连接、监控逻辑)\n├── efak-dto/         # 数据传输对象\n├── efak-tool/        # 工具类模块\n└── efak-web/         # Web 应用模块 (控制器、服务、前端)\n```\n\n### 技术栈\n- **后端框架**: Spring Boot 3.4.5\n- **数据库**: MySQL 8.0+ (主数据库)\n- **缓存**: Redis 6.0+ (分布式锁、任务调度)\n- **消息队列**: Apache Kafka 4.0.0\n- **ORM**: MyBatis 3.0.4\n- **前端**: Thymeleaf\n- **构建工具**: Maven 3.6+\n- **Java 版本**: JDK 17\n\n## 快速开始\n\nEFAK-AI 提供两种部署方式：**Docker 容器化部署**（推荐）和 **tar.gz 安装包部署**。\n\n### 🚀 一键启动（超简单！）\n\n```bash\n# 克隆项目\ngit clone https://github.com/smartloli/EFAK-AI.git\ncd EFAK-AI\n\n# 运行快速启动脚本\n./quick-start.sh\n```\n\n快速启动脚本提供：\n1. Docker 一键部署\n2. tar.gz 安装包构建\n3. 日志查看和服务管理\n\n### 方式一：Docker 部署（推荐）⚡\n\n#### 环境要求\n- Docker Desktop 4.43.2+\n- Docker Compose 2.0+\n\n#### 一键启动\n```bash\n# 1. 克隆项目\ngit clone https://github.com/smartloli/EFAK.git\ncd EFAK\n\n# 2. 启动所有服务（包括 MySQL、Redis）\ndocker-compose up -d\n\n# 3. 查看日志\ndocker-compose logs -f efak-ai\n\n# 4. 访问应用\n# http://localhost:8080\n# 默认账号: admin / admin\n\n# 5. 重置密码\n# http://localhost:8080/password-tool\n```\n\n#### 启动 Nginx 反向代理（可选）\n```bash\n# 使用 nginx profile 启动\ndocker-compose --profile nginx up -d\n\n# 通过 http://localhost (80端口) 访问\n```\n\n#### 常用 Docker 命令\n```bash\n# 查看运行状态\ndocker-compose ps\n\n# 停止服务\ndocker-compose down\n\n# 重启服务\ndocker-compose restart efak-ai\n\n# 查看日志\ndocker-compose logs -f\n```\n\n### 方式二：tar.gz 安装包部署\n\n#### 环境要求\n- JDK 17+\n- MySQL 8.0+\n- Redis 6.0+\n\n#### 1. 构建安装包\n```bash\n# 克隆项目\ngit clone https://github.com/smartloli/EFAK.git\ncd EFAK\n\n# 执行构建脚本\n./build-package.sh\n\n# 生成安装包: efak-5.0.0.tar.gz\n```\n\n#### 2. 部署安装包\n```bash\n# 传输到服务器（如果需要）\nscp efak-ai-5.0.0.tar.gz user@server:/opt/\n\n# 解压\ncd /opt\ntar -zxvf efak-ai-5.0.0.tar.gz\ncd efak-ai-5.0.0\n\n# 目录结构\n# bin/      - 启动脚本\n# config/   - 配置文件\n# libs/     - JAR 包\n# logs/     - 日志目录\n# sql/      - SQL 脚本\n```\n\n#### 3. 初始化数据库\n```bash\nmysql -u root -p\nCREATE DATABASE efak_ai CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\nUSE efak_ai;\nSOURCE /opt/efak-ai-5.0.0/sql/ke.sql;\n```\n\n#### 4. 修改配置\n编辑 `config/application.yml`:\n```yaml\nspring:\n  datasource:\n    url: jdbc:mysql://localhost:3306/efak_ai?useUnicode=true\u0026characterEncoding=UTF-8\u0026serverTimezone=Asia/Shanghai\n    username: root\n    password: your_password\n  data:\n    redis:\n      host: localhost\n      port: 6379\n```\n\n#### 5. 启动应用\n```bash\n# 启动\n./bin/start.sh\n\n# 查看日志\ntail -f logs/efak-ai.log\n\n# 查看状态\n./bin/status.sh\n\n# 停止\n./bin/stop.sh\n\n# 重启\n./bin/restart.sh\n```\n\n#### 6. 访问应用\n- 应用地址: http://localhost:8080\n- 默认账号: admin / admin123\n\n#### 7. 验证进程\n```bash\n# 查看进程（进程名显示为 KafkaEagle）\nps aux | grep KafkaEagle\n```\n\n### 详细部署文档\n\n完整的部署指南、配置说明和故障排查，请参阅：\n- 📖 [详细部署文档](efak-web/src/main/resources/docs/DEPLOY.md)\n- 🚀 [功能预览文档](efak-web/src/main/resources/docs/FEATURE_PREVIEW.md)\n\n\n## 开发指南\n\n### 本地开发环境\n\n#### 环境要求\n- JDK 17+\n- Maven 3.6+\n- MySQL 8.0+\n- Redis 6.0+\n\n#### 开发步骤\n```bash\n# 1. 克隆项目\ngit clone https://github.com/smartloli/EFAK.git\ncd EFAK\n\n# 2. 创建数据库并导入 SQL 脚本\nmysql -u root -p\nCREATE DATABASE efak_ai CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\nUSE efak_ai;\nSOURCE efak-web/src/main/resources/sql/ke.sql;\n# ... 导入其他 SQL 脚本\n\n# 3. 修改配置文件\nvi efak-web/src/main/resources/application.yml\n\n# 4. 编译项目\nmvn clean compile -DskipTests\n\n# 5. 运行应用\ncd efak-web\nmvn spring-boot:run\n```\n\n## 配置说明\n\n### 核心配置文件\n\n#### application.yml\n```yaml\n# 数据库配置\nspring:\n  datasource:\n    url: jdbc:mysql://localhost:3306/efak_ai?useUnicode=true\u0026characterEncoding=UTF-8\u0026serverTimezone=Asia/Shanghai\n    username: root\n    password: admin123\n\n# Redis 配置\n  data:\n    redis:\n      host: localhost\n      port: 6379\n      database: 0\n\n# 服务端口\nserver:\n  port: 8080\n```\n\n### 环境变量配置（Docker）\n\n| 变量名 | 说明 | 默认值 |\n|--------|------|--------|\n| `SPRING_DATASOURCE_URL` | 数据库连接 URL | jdbc:mysql://mysql:3306/efak_ai |\n| `SPRING_DATASOURCE_USERNAME` | 数据库用户名 | root |\n| `SPRING_DATASOURCE_PASSWORD` | 数据库密码 | admin123 |\n| `SPRING_DATA_REDIS_HOST` | Redis 主机 | redis |\n| `SPRING_DATA_REDIS_PORT` | Redis 端口 | 6379 |\n| `SERVER_PORT` | 应用端口 | 8080 |\n| `JAVA_OPTS` | JVM 参数 | -Xms512m -Xmx2g |\n\n### JVM 参数调优\n\n根据服务器内存调整：\n```bash\n# 小内存（2GB）\nJAVA_OPTS=\"-Xms256m -Xmx1g -XX:+UseG1GC\"\n\n# 中等内存（4GB）\nJAVA_OPTS=\"-Xms512m -Xmx2g -XX:+UseG1GC\"\n\n# 大内存（8GB+）\nJAVA_OPTS=\"-Xms1g -Xmx4g -XX:+UseG1GC -XX:MaxGCPauseMillis=200\"\n```\n\n## API 文档\n\n### 健康检查 API\n```bash\n# 基础健康检查\nGET /health/check\n\n# 响应示例\n{\n    \"application\": \"EFAK-AI\",\n    \"port\": \"8080\",\n    \"version\": \"5.0.0\",\n    \"status\": \"UP\",\n    \"timestamp\": \"2025-10-06T23:32:47.392037\"\n}\n```\n\n### AI 助手 API\n```bash\n# SSE 流式聊天（推荐）\nGET /api/chat/stream?modelId=1\u0026message=分析集群性能\u0026clusterId=xxx\u0026enableCharts=true\n\n# 返回: Server-Sent Events 流式响应\ndata: {\"type\":\"thinking\",\"content\":\"正在分析...\"}\ndata: {\"type\":\"content\",\"content\":\"根据查询结果...\"}\ndata: {\"type\":\"chart\",\"chartData\":\"{\\\"type\\\":\\\"line\\\",...}\"}\ndata: {\"type\":\"end\"}\n```\n\n### 集群监控 API\n```bash\n# 获取集群列表\nGET /api/cluster/list\n\n# 获取集群详情\nGET /api/cluster/info?clusterId=xxx\n\n# 获取 Broker 信息\nGET /api/cluster/brokers?clusterId=xxx\n\n# 获取 Topic 列表\nGET /api/topic/list?clusterId=xxx\n\n# 获取 Topic 指标\nGET /api/topic/metrics?clusterId=xxx\u0026topic=xxx\n\n# 获取消费者组信息\nGET /api/consumer/groups?clusterId=xxx\n```\n\n## 开发指南\n\n### 项目结构\n```\nefak-web/src/main/java/org/kafka/eagle/\n├── web/\n│   ├── controller/     # 控制器层\n│   ├── service/        # 服务层\n│   ├── mapper/         # 数据访问层\n│   ├── config/         # 配置类\n│   ├── security/       # 安全配置\n│   └── scheduler/      # 任务调度\n├── core/               # 核心业务逻辑\n├── dto/                # 数据传输对象\n└── tool/               # 工具类\n```\n\n### 开发规范\n- 使用 Java 17 特性\n- 遵循 Spring Boot 最佳实践\n- 使用 Lombok 简化代码\n- 统一异常处理和日志记录\n- 编写单元测试和集成测试\n\n## 贡献指南\n\n1. Fork 项目\n2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)\n3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)\n4. 推送到分支 (`git push origin feature/AmazingFeature`)\n5. 打开 Pull Request\n\n## 许可证\n\n本项目基于 Apache License 2.0 许可证开源。详情请参阅 [LICENSE](LICENSE) 文件。\n\n## 联系方式\n\n- 官网主页: https://www.kafka-eagle.org/\n- 项目主页: https://github.com/smartloli/EFAK\n- 问题反馈: https://github.com/smartloli/EFAK/issues\n- 作者: Mr.SmartLoli\n\n## 更新日志\n\n### v5.0.0 (2025-10-06)\n- ✨ 集成 AI 智能助手功能\n- ✨ 实现分布式任务调度系统\n- ✨ 支持多种大语言模型\n- ✨ 完善告警管理系统\n- ✨ 优化用户界面和用户体验\n\n---\n\n**EFAK-AI** - 让 Kafka 监控更智能，让运维更高效！\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartloli%2Fefak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartloli%2Fefak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartloli%2Fefak/lists"}