ECS765P - W3 - Hadoop Principles and Components
ECS765P - W3 - Hadoop Principles and Components
Follower (1..*)
● Worker node
● Executes the tasks the leader tells it to do
Hadoop Leader-Follower architecture
from the daemon’s point of view:
Contents
NameNode maintains the data that provides information about DataNodes like which block is mapped to which
DataNode (this information is called metadata) and also executes operations like the renaming of files.
HDFS Datanode (Slave Node)
DataNodes store the actual data and also perform tasks like replication and deletion of data as instructed by
NameNode. DataNodes also communicate with each other.
Hadoop Nodes Daemons
● DataNode (1 ..* per cluster)
Stores blocks from the HDFS
Report periodically to NameNode list of stored blocks
● NameNode (1 per cluster)
Keeps index table with (all) the locations of each block
Heavy task, no computation responsibilities Daemons have no computation responsibilities!
Note: Client is an interface that communicates with NameNode for metadata and DataNodes for read
and writes operations.
HDFS File Read operation
HDFS File Write operation
(only contact one datanode)
7: complete
Contents
● Job allocation
● Job execution
Application Manager
Three different schedulers available in YARN
● FIFO
● Capacity
● Fair
FIFO Scheduler
First in, first out. Requests for the first application in the queue are allocated first; once its requests have
been satisfied, the next application in the queue is served, and so on.
● Easy to understand
● No configuration necessary
● Not suitable for shared clusters
● Large applications will use all resources in the cluster so each application will have to wait its turn
FIFO Scheduler
Capacity Scheduler
A separate dedicated queue allows a small job to start as soon as it is submitted
● Large jobs finish later
● Smaller jobs get results back in reasonable time
● The overall cluster utilization can be low since the queue capacity is reserved for jobs in that queue
Capacity Scheduler
Fair Scheduler
Cluster will dynamically balance resources between all running jobs. Just after the first (large) job starts, it
is the only job running, so it gets all the resources in the cluster. When the second (small) job starts, it is
allocated half of the cluster resources so that each job is using its fair share of resources.
● Lag between the time the second job starts and when it receives its fair share, since it has to wait for
resources to free up as containers used by the first job complete.
● High cluster utilization
● Timely small job completion
Fair Scheduler
Quiz!
The Apache Hadoop Ecosystem
TGTs last 10 hours by default to user will only need go through this process every 10 hours (This is also
configurable). Kind of similar to Single Sign-on (SSO)
Kerebos
Zookeeper
● Distributed, open-source coordination service for distributed applications.
keeps the distributed system functioning together as a single unit via synchronization and coordination
● Quorum algorithms for selecting leaders, agreeing on shared state
The minimum number of servers required to run the Zookeeper is called Quorum. Zookeeper replicates
whole data tree to all the quorum servers
https://medium.com/@akashsingla19/zookeeper-quorum-44906bb17d74
Hadoop with Automated failover
ZKFailoverController (ZKFC) is a ZooKeeper client which implements automated failover for the
NameNodes (master and secondaries) by:
● Failure detection - each NameNode maintains a persistent session in ZooKeeper. If the machine
crashes, the ZooKeeper session will expire, notifying the other NameNodes that a failover should be
triggered.
● Active NameNode election - If the active NameNode crashes, another node may take a special
exclusive lock in ZooKeeper indicating that it should become the next active.
https://docs.cloudera.com/HDPDocuments/HDP3/HDP-3.0.0/fault-
tolerance/content/configuring_and_deploying_namenode_automatic_failover.html
Flume
● Flume runs agents which are long-lived Java process that run sources and sinks, connected by channels
● A source in Flume produces events and delivers them to the channel
● The channel stores the events until they are forwarded to the sink
● The Flume installation is made up of a collection of connected agents running in a distributed topology
https://flume.apache.org/FlumeUserGuide.html
Flume
• Flume event is defined as a unit of data flow having a byte payload and an optional set of string
attributes
• Flume Agent is a (JVM) process that hosts the components through which events flow from an
external source to the next destination
Contents