Alerting, Health-Check Automation and Operational Runbooks

Big Data and Hadoop Administrator 13 min min read Updated: Nov 17, 2026 Intermediate
Alerting, Health-Check Automation and Operational Runbooks
Intermediate Topic 4 of 4

What Good Operations Looks Like

  • Problems are found by alerts, not by users
  • Every alert has a runbook with first steps
  • Routine checks are automated and recorded
  • Incidents lead to written reviews and fixes
  • Changes are planned, tested and reversible

Daily, Weekly and Monthly Routine

FrequencyTask
DailyHDFS capacity and growth, missing/under-replicated blocks, dead DataNodes, unhealthy NodeManagers, failed jobs and top resource users, backup job results, alert review
WeeklySmall file and quota report, top users, long-running jobs, log disk usage, pending OS patches, certificate expiry list
MonthlyCapacity forecast, access review (Ranger and groups), restore test, disaster recovery check, configuration drift check, upgrade planning
QuarterlyFailover tests (NameNode, RM, ZooKeeper), security review, game day

Daily Health Report Script

bash #!/bin/bash # daily_report.sh : sends one email summary every morning (cron: 0 7 * * *) { echo "== HDFS ==" hdfs dfsadmin -report | sed -n '1,12p' hdfs dfsadmin -report -dead | head -20 hdfs fsck / 2>/dev/null | tail -15 echo; echo "== HA ==" hdfs haadmin -getAllServiceState; yarn rmadmin -getAllServiceState echo; echo "== YARN ==" yarn node -list -states UNHEALTHY,LOST yarn application -list -appStates FAILED 2>/dev/null | head -20 echo; echo "== Backups ==" tail -3 /var/log/hadoop-backup/last_run.log echo; echo "== Disk (workers sample) ==" ansible workers -m shell -a "df -h /data/* | awk '\$5+0>80'" -o 2>/dev/null | head -20 } | mail -s "Hadoop daily report $(date +%F)" hadoop-admins@example.com

Alert Severity Levels

LevelMeaningExampleResponse
P1 CriticalOutage or data at riskNo active NameNode, missing blocks, DR downPage on-call immediately, 15 min
P2 HighDegraded serviceOne DataNode rack down, queue backlogRespond within 1 hour
P3 WarningWill become a problemDisk 80% full, cert expires in 30 daysNext business day
P4 InfoAwarenessJob failure rate slightly upWeekly review

Runbook Template

text RUNBOOK: <Alert name> Impact: who/what is affected Severity: P1/P2/P3 Detect: which alert, dashboard, command Diagnose: step-by-step commands with expected output Fix: numbered steps; mark any risky step Verify: commands proving it is fixed Escalate: who to call, when (time limit) After: follow-ups, ticket, review needed? Owner / last tested date

Example Runbook: DataNode Disk Full

text Impact: Writes to that node fail or are redirected, job slowness, balancer imbalance Detect: Alert DiskAlmostFull{mountpoint=/data/d3} Diagnose: 1. df -h /data/* -> which volume 2. du -sh /data/d3/dn/current/* | sort -h | tail 3. hdfs dfsadmin -report -datanode worker12 -> DFS Used%, Non DFS Used (logs? tmp?) Fix: a. If non-DFS data (logs, core dumps, tmp): remove/rotate it (safe) b. If HDFS data: run balancer -> hdfs balancer -threshold 5 c. If whole cluster is >80%: escalate P2 to capacity planning, add nodes or delete old data d. Do NOT delete files inside /data/d3/dn/current by hand Verify: usage under 80%, no new alerts Escalate: if the cluster is above 85% used and growing, page the platform lead

Example Runbook: HDFS in Safe Mode

text Detect: NameNode UI banner "Safe mode is ON", clients get SafeModeException Diagnose: 1. hdfs dfsadmin -safemode get 2. NameNode log: "reported blocks X needs additional Y blocks" 3. hdfs dfsadmin -report | head -- how many DataNodes are live? Fix: a. Startup still in progress and DataNodes are registering -> wait b. DataNodes down -> start them (systemctl), check network/firewall c. Real missing blocks (disks lost) -> restore nodes first; only then consider `hdfs dfsadmin -safemode leave` with approval and a list of lost files from fsck Verify: safemode OFF, MissingBlocks = 0

Example Runbook: Dead DataNode

  1. Is the host reachable? ping, ssh
  2. Is the process running? systemctl status hadoop-datanode, jps
  3. Read the last 100 lines of the DataNode log
  4. Common causes: out of memory, disk failure, Too many open files, clusterID mismatch
  5. Restart once. If it fails again, do not keep restarting in a loop, investigate
  6. If the node will be out for more than 1 hour, check under-replicated blocks and re-replication rate

Change Management

  • Every config change in Git with a pull request and review
  • Test on a lab or one canary node first
  • Rolling changes with health checks between batches
  • A written rollback step in the change ticket
  • Announce maintenance windows to users

Learn from Incidents: Blameless Review

QuestionExample answer
What happened (timeline)?10:02 alert, 10:10 on-call acknowledged, 10:40 fixed
Why (root cause, not person)?No quota on a tmp directory filled the cluster
What worked?Alert fired, runbook was clear
What to change?Add quotas, alert at 75%, update runbook
Practice: Run a game day every quarter: kill the active NameNode, fill a test disk, expire a certificate in the lab. Teams that practise recover faster.

Conclusion

Combine monitoring with a daily routine, severity-based alerts, tested runbooks, controlled changes and blameless reviews. This is what separates a reliable platform from a fragile one.

Quick Summary: routine + alerts + runbooks + change control + reviews.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators