Module 4: The Hadoop Ecosystem
Overview
Apache Hadoop made it possible to store and process very large datasets on clusters of ordinary computers. This module covers how a compute cluster works, distributed storage with HDFS, resource management with YARN, the MapReduce programming model, and the wider ecosystem (Hive, Pig, Ambari and others). It ends with how to get Hadoop in practice, from vendor platforms to managed cloud services such as Google Cloud Dataproc and AWS EMR. Hands-on work uses a shared Hadoop cluster on Google Cloud Dataproc.
Estimated time: about 4 hours (lecture and two labs on the shared cluster)
Learning objectives
By the end of this module, you should be able to:
- Describe how a compute cluster is organised, and the main challenges of distributed computing: communication costs, node failures and administration.
- Explain how HDFS stores data: the NameNode and DataNodes, splitting files into blocks, and replication for fault tolerance.
- Trace a MapReduce job (map, shuffle and sort, reduce) through the word-count example, and explain why MapReduce is hard to use for iterative and interactive work.
- Explain the role of YARN, and identify which components are core to Hadoop and which belong to the wider ecosystem.
- Compare options for getting Hadoop: building your own cluster, vendor distributions, and managed cloud services such as Google Cloud Dataproc and AWS EMR.
- Load and explore data in HDFS, and process it with a MapReduce job, Hive and PySpark on a real cluster.
Before class
The labs run on a shared Hadoop cluster in Google Cloud, so there is nothing to install. On Day 1, give the instructors your Google account email so they can give you access, and read Hadoop cluster (Google Cloud Dataproc) before the first lab.
Prerequisites: Module 1 (parallel and distributed processing) and map/reduce from Module 2. Basic comfort with a terminal helps.
Lecture slides
Hands-on
Two labs on the shared Hadoop cluster (Google Cloud Dataproc). The step-by-step instructions are handed out in class.
- Lab 1: HDFS. Load data into your own HDFS folder and explore it with HDFS commands and the HDFS web interface.
- Lab 2: MapReduce, Hive and PySpark. Process the same data three ways: a MapReduce job, Hive queries, and PySpark.
MapReduce examples:
WordCount.java: the classic MapReduce word-count example in Java.mapper.pyandreducer.py: a Hadoop Streaming job in Python that counts calls per cell tower; used in Lab 2.
Exercises
To be added.
Further reading
- HDFS architecture guide (Apache Hadoop documentation)
- MapReduce tutorial (Apache Hadoop documentation)
- Leskovec, Rajaraman & Ullman, Mining of Massive Datasets (free online), chapter 2 on MapReduce
- Videos from the slides: HDFS in brief, MapReduce in brief and YARN in depth
- Google Cloud Dataproc documentation
- Kubernetes: increasingly used instead of YARN to run big data workloads