微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🐘

大数据集群运维诊断专家

Hadoop · v1.0.0
这个包缺安装入口,装上也不会生效 缺 SKILL.md 或 frontmatter 不完整(BAD_NAME)。我们仍保留下载,方便你自行查看内容。
专业技能 安全 B 级 作者 ivangdavila 公开目录收录
988 下载 0 安装 3.6k 收藏 10 浏览

简介

面向大数据运维的 Hadoop 集群管理专家,覆盖 HDFS 存储诊断、YARN 资源调度与分布式故障排查,适合数据工程师与平台运维人员。

原始描述

Manage Hadoop clusters with HDFS operations, YARN job tuning, and distributed processing diagnostics.

通过你的 Agent 添加

安装目录:hadoop/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/hadoop/
Codex CLI~/.codex/skills/hadoop/
DeepSeek Harness~/.agents/skills/hadoop/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

Hadoop 技能是面向 Apache Hadoop 生态系统的专业集群运维工具,核心功能涵盖三大维度:

HDFS 存储管理 — 提供完整的分布式文件系统操作能力,包括容量监控(hdfs dfsadmin -report)、块健康检查(hdfs fsck)、副本因子调整及损坏数据修复。支持智能存储决策,如为临时数据降低副本数以节省空间,或为关键数据强制校验复制状态。

YARN 资源调度 — 深度集成作业生命周期管理,从队列监控、应用状态追踪到资源重分配。内置调度器识别(Capacity/Fair Scheduler),帮助用户理解不同调度策略下的资源分配行为,避免"任务被杀"类问题的盲目排查。

故障诊断体系 — 建立标准化的诊断流程:先验集群健康(NameNode/DataNode 状态)→ 查存储瓶颈 → 核资源配置 → 定位日志。明确关键日志路径(NameNode、ResourceManager、NodeManager 等),解决 Hadoop 日志分散导致的排查困难。

显著优点

  • 诊断流程标准化:强制"Verify Cluster State First"规则,避免运维人员跳过基础检查直接排查业务代码,显著缩短 MTTR
  • 资源感知设计:内置 Replication Factor、Memory Settings、Scheduler Type 等关键配置提醒,90% 的容器被杀问题可定位至内存参数不匹配
  • 安全操作边界:破坏性操作(skipTrash 删除、强制退出 Safe Mode)明确标注风险,要求显式确认
  • 场景化知识嵌入:针对"集群满但删除无效"(Trash 机制)、"时区导致调度错乱"等真实陷阱提供预判指导

潜在局限

  • 环境依赖严格:要求预装 hdfs/yarn/hadoop 二进制文件,且仅支持 Linux/macOS 环境,Windows 用户需额外配置
  • 无自动凭证管理:Kerberos 认证(kinit/keytab)需用户独立处理,技能本身不托管安全凭证
  • 集群级操作风险:fsck 等命令在繁忙集群运行可能引发性能抖动,需人工判断维护窗口
  • 生态覆盖有限:聚焦 HDFS/YARN/MapReduce,对上层组件(Hive、Spark、HBase)仅作关联提及,深度问题需配合其他技能

适合人群

  • 数据平台运维工程师:负责 Hadoop 集群日常巡检、容量规划、故障响应
  • 大数据开发工程师:需要自助排查作业失败原因,优化 MapReduce/Spark on YARN 资源参数
  • SRE/系统管理员:从传统 Linux 运维扩展至分布式存储与计算治理

常规风险

风险场景 说明
Safe Mode 强制退出 若实际存在块缺失,强制退出将导致元数据不一致,可能丢失数据
Trash 机制误解 删除大文件后 Trash 仍占存储,集群"满"状态持续,易误判为删除失败
内存参数倒挂 容器内存 < JVM 堆内存时,Linux OOM Killer 介入,日志指向不明
调度器行为差异 Capacity 与 Fair Scheduler 的队列抢占、资源预留逻辑截然不同,配置迁移易引发资源争抢
fsck 性能冲击 在活跃集群执行全量文件系统检查,可能阻塞 NameNode RPC

最佳实践建议

  1. 建立集群画像:使用 ~/hadoop/clusters/{name}.md 维护每套环境的版本、调度器类型、节点规格等上下文
  2. 变更前快照:调整副本因子或队列配置前,记录当前 dfsadmin -report 与 yarn queue -status 基线
  3. 日志聚合习惯:将分散的组件日志路径纳入集中采集(ELK/Loki),弥补技能本地化的日志查看局限

技能正文


name: Hadoop slug: hadoop version: 1.0.0 homepage: https://clawic.com/skills/hadoop description: Manage Hadoop clusters with HDFS operations, YARN job tuning, and distributed processing diagnostics. metadata: {"clawdbot":{"emoji":"🐘","requires":{"bins":["hdfs","yarn","hadoop"]},"os":["linux","darwin"]}}

Setup

If ~/hadoop/ doesn't exist or is empty, read setup.md and start the conversation naturally.

When to Use

User works with Hadoop ecosystem (HDFS, YARN, MapReduce, Hive). Agent handles cluster diagnostics, job optimization, storage management, and troubleshooting distributed processing failures.

Architecture

Memory lives in ~/hadoop/. See memory-template.md for structure.

~/hadoop/
├── memory.md        # Cluster configs, common issues, preferences
├── clusters/        # Per-cluster notes and configs
│   └── {name}.md    # Specific cluster context
└── scripts/         # Custom diagnostic scripts

Quick Reference

Topic File
Setup process setup.md
Memory template memory-template.md
HDFS operations hdfs.md
YARN tuning yarn.md
Troubleshooting troubleshooting.md

Core Rules

1. Verify Cluster State First

Before any operation, check cluster health:

hdfs dfsadmin -report
yarn node -list

Never assume cluster is healthy. A single dead DataNode changes everything.

2. Storage Before Compute

HDFS issues cascade into job failures. Always check:

hdfs dfs -df -h                    # Capacity
hdfs fsck / -files -blocks         # Block health

A job failing with "No space left" is storage, not code.

3. Resource Calculator Awareness

YARN allocates based on configured scheduler. Know which is active:

yarn rmadmin -getServiceState rm1
cat /etc/hadoop/conf/yarn-site.xml | grep scheduler

Default (Capacity) vs Fair scheduler behave very differently.

4. Replication Factor Context

Default replication=3. For temp data, suggest 1-2 to save space:

hdfs dfs -setrep -w 1 /tmp/scratch/

For critical data, verify replication is honored:

hdfs fsck /data/critical -files -blocks -replicaDetails

5. Log Location Awareness

Hadoop logs scatter across machines. Key locations:

Component Log Path
NameNode /var/log/hadoop-hdfs/hadoop-hdfs-namenode-*.log
DataNode /var/log/hadoop-hdfs/hadoop-hdfs-datanode-*.log
ResourceManager /var/log/hadoop-yarn/yarn-yarn-resourcemanager-*.log
NodeManager /var/log/hadoop-yarn/yarn-yarn-nodemanager-*.log
Application yarn logs -applicationId <app_id>

6. Safe Mode Handling

NameNode enters safe mode on startup or low block count:

hdfs dfsadmin -safemode get        # Check status
hdfs dfsadmin -safemode leave      # Exit (if blocks OK)

Never force-leave if blocks are actually missing.

7. Memory Settings Matter

90% of "job killed" issues are memory:

# Container settings
yarn.nodemanager.resource.memory-mb     # Total per node
yarn.scheduler.minimum-allocation-mb    # Min container
mapreduce.map.memory.mb                 # Map task
mapreduce.reduce.memory.mb              # Reduce task

Check these before assuming code is wrong.

HDFS Operations

Essential Commands

# Navigation
hdfs dfs -ls /path
hdfs dfs -du -h /path              # Size with human units
hdfs dfs -count -q /path           # Quota info

# Data movement
hdfs dfs -put local.txt /hdfs/     # Upload
hdfs dfs -get /hdfs/file.txt .     # Download
hdfs dfs -cp /src /dst             # Copy within HDFS
hdfs dfs -mv /src /dst             # Move within HDFS

# Maintenance
hdfs dfs -rm -r /path              # Delete (trash)
hdfs dfs -rm -r -skipTrash /path   # Delete (permanent)
hdfs dfs -expunge                  # Empty trash

Block Management

# Find corrupt blocks
hdfs fsck / -list-corruptfileblocks

# Delete corrupt file (after confirming unrecoverable)
hdfs fsck /path/file -delete

# Force replication
hdfs dfs -setrep -w 3 /important/data/

YARN Job Management

Application Lifecycle

# List applications
yarn application -list                    # Running
yarn application -list -appStates ALL     # All states

# Application details
yarn application -status <app_id>

# Kill stuck application
yarn application -kill <app_id>

# Get logs (after completion)
yarn logs -applicationId <app_id>
yarn logs -applicationId <app_id> -containerId <container_id>

Queue Management

# List queues
yarn queue -list

# Queue status
yarn queue -status <queue_name>

# Move application between queues
yarn application -movetoqueue <app_id> -queue <target_queue>

Common Traps

  • Deleting without -skipTrash on full cluster → Trash still uses space, cluster stays full
  • Setting container memory below JVM heap → Instant container kill, confusing errors
  • Ignoring speculative execution on slow jobs → Wastes resources on duplicated tasks
  • Running fsck on busy cluster → Performance impact, run during maintenance
  • Assuming HDFS = POSIX semantics → No append-in-place, no random writes
  • Forgetting timezone in scheduling → Oozie/Airflow jobs fire at wrong times

Security & Privacy

Data that stays local:

  • Cluster notes saved in ~/hadoop/clusters/
  • Preferences and environment context

What commands access:

  • hdfs/yarn commands connect to your Hadoop cluster
  • Some commands read system paths (/var/log, /etc/hadoop/conf)
  • Destructive commands require explicit user confirmation

This skill does NOT:

  • Store credentials (use kinit/keytab separately)
  • Make external API calls beyond your cluster
  • Run destructive commands without asking first

Related Skills

Install with clawhub install <slug> if user confirms:

  • linux — system administration
  • docker — containerized deployments
  • bash — shell scripting

Feedback

  • If useful: clawhub star hadoop
  • Stay updated: clawhub sync

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

hadoophdfsyarnbig-datacluster-managementmapreducedistributed-storagedata-engineering

同类 Skill