Systematic Troubleshooting Playbook and Real-World Case Studies
The Layered Method
text
Layer 5 Application : job code, queries, data volume, users
Layer 4 Service : HDFS, YARN, Hive, Kafka state, config, versions
Layer 3 JVM : heap, GC, threads, file descriptors
Layer 2 OS / hardware : CPU, memory, disk, kernel messages, clocks
Layer 1 Network : DNS, routes, firewalls, switches, bandwidth
Go up from the bottom when everything is slow, go down from the top when one job fails.
Evidence Collection Toolkit
bash
# OS
uptime; free -m; df -h; dmesg -T | tail -50; iostat -x 2 3; sar -n DEV 2 3
journalctl -p err --since "2 hours ago"
# Network and DNS
dig +short $(hostname -f); dig -x $(hostname -i); nc -vz nn1 8020; mtr -rwc 20 nn1
# JVM
PID=$(pgrep -f proc_namenode | head -1)
jstack $PID > /tmp/nn-threads-1.txt ; sleep 10; jstack $PID > /tmp/nn-threads-2.txt # take 3 dumps 10 s apart
jmap -histo:live $PID | head -30
jcmd $PID GC.heap_info
ls /proc/$PID/fd | wc -l
# Heap dump (pauses the process, do on a standby if possible)
jmap -dump:live,format=b,file=/tmp/nn.hprof $PID
Keep evidence: Save logs, thread dumps and metric screenshots before restarting. A restart often hides the cause forever.
Case Study 1: NameNode Failover Loop
| Symptom | Active NameNode flips every few minutes, jobs fail with StandbyException |
| Evidence | ZKFC log: Session expired; NameNode GC log: Full GC pauses of 25 to 40 seconds |
| Root cause | Heap grew with namespace and a quiet heap increase was never done. Pauses exceeded ZooKeeper session timeout |
| Fix | Increase heap and tune G1GC; raise ha.zookeeper.session-timeout.ms temporarily; clean up small files |
| Prevention | Heap-after-GC alert at 70%, quarterly capacity review |
Case Study 2: Cluster Suddenly Slow Every Morning
| Symptom | At 08:00 every day jobs take 3x longer |
| Evidence | NameNode RpcQueueTimeAvgTime spike, audit log shows 40 million listStatus calls from one user |
| Root cause | A new dashboard job listed a directory with 5 million files in a loop |
| Fix | Moved job to partitioned layout, added name quotas, enabled RPC fairness (ipc.<port>.callqueue.impl / FairCallQueue) |
| Prevention | Per-user RPC metrics in Grafana, user onboarding guide |
xml
<!-- core-site.xml: fair call queue so one user cannot starve others -->
<property><name>ipc.8020.callqueue.impl</name><value>org.apache.hadoop.ipc.FairCallQueue</value></property>
<property><name>ipc.8020.scheduler.impl</name><value>org.apache.hadoop.ipc.DecayRpcScheduler</value></property>
<property><name>ipc.8020.backoff.enable</name><value>true</value></property>
Case Study 3: Jobs Fail After Certificate Renewal
| Symptom | Hive and Knox requests fail with PKIX path building failed |
| Evidence | HS2 log SSL exception, new cert issued by a new intermediate CA |
| Root cause | Truststores on clients lacked the new intermediate certificate |
| Fix | Import the chain into truststores via Ansible, rolling restart |
| Prevention | Certificate inventory with expiry alerts, test renewals in lab |
Case Study 4: HDFS 90% Full After a Weekend
| Symptom | Capacity alarm rises from 70% to 90% in two days |
| Evidence | hdfs dfs -du shows /tmp/spark-staging and /spark-history huge; one user's streaming job writes hourly tiny files |
| Root cause | A failing streaming job restarted every minute, each time writing a new set of checkpoint and temp files |
| Fix | Stopped the job, cleaned temp directories, added quota to /tmp, fixed the job's failure |
| Prevention | Quotas for /tmp, cleanup job for staging dirs, alert on daily growth rate |
Case Study 5: Random Task Failures on One Rack
| Symptom | Tasks fail with timeouts only when running on rack 3 |
| Evidence | ip -s link shows CRC errors; iperf3 shows 1 Gbit instead of 10 |
| Root cause | Faulty top-of-rack switch uplink negotiating at a lower speed with packet loss |
| Fix | Replace the cable and optic; decommission rack temporarily during repair |
| Prevention | Network error counters in monitoring, burn-in tests on new racks |
Common Root Cause Categories
| Category | Share (typical) | Examples |
|---|---|---|
| Capacity and resource exhaustion | High | Disk full, heap, file descriptors, queue limits |
| Configuration changes | High | Wrong value pushed to all nodes, drift between nodes |
| Network and DNS | Medium | Reverse DNS, MTU, switch errors |
| Bad workload | Medium | Small files, skew, runaway jobs |
| Expiry (certs, keytabs, passwords) | Medium | Keytab key version mismatch, expired TLS cert |
| Hardware | Low to medium | Disks, memory, NICs |
Write the postmortem: For every case above the learning is the prevention row. Put prevention items on a tracked list, with owners and dates, or the incident will repeat.
Conclusion
Troubleshoot layer by layer, collect evidence before restarting, and learn from patterns: heap and GC, noisy users, expired certificates, runaway jobs and network faults. Prevention work matters as much as the fix.
Quick Summary: layers, evidence first, root cause, prevention list.

