Professional Documents
Culture Documents
Dinkar Sitaram
Prof. K V Subramaniam
Prof. Sanchika Gupta
Prof. Prafullata K A
Prof Mamatha Shetty
▪ Install ZooKeeper
▪ Create a zookeeper client as a process and
register with zookeeper
Try out how to create a znode – persistent
Persistent znodes used for things like configuration
information – port on which to listen to etc.
Then create an ephemeral znode
Check what happens on zookeeper when the zookeeper
client process is killed
Now try a ephemeral sequential znode
Try two instances of the process
See what numbers each one gets.
Recall: Reading a file
How does this translate to HDFS?
https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-
hdfs/HDFSHighAvailabilityWithNFS.html#Architecture
Failover Controller
▪ Zookeeper Failover Controller – monitors and manages
state of the NameNode
▪ Runs on the NameNode
▪ Responsible for
Health monitoring:
pings the local NameNode
HealthCheck Command
Session Management
Keeps on open session with ZooKeeper
Also holds the lock for active NameNode
Zookeeper based election
If current node is active and no other node has a lock
Then it will initiate process to get a lock
Success → it has won the election
Class Exercise (10 mins)
▪ Namenode stores
Edit.logs and fsimage in persistent store
In memory block mappings
▪ How will you get the standby node to keep
track of this information?
Method 1: Shared storage
▪ Regular Operation
Shared storage stores
edit logs
DataNodes send block
mappings to both
Active/Standby
▪ On Failure
Standby has block
mappings already in Name Edit logs Shared storage
memory node
Clients Transparency Provide failover
Method 2:Quorum Journal
Manager
▪ Additional servers
configured as JournalNodes
▪ At least 3 (odd number)
▪ Active NameNode Write
Sent to JournalNodes
Majority to succeed
▪ Standby NameNode Read
Watches for changes in edit
logs and applies them
Before becoming active
▪ Only one writer allowed at a
time
Class Exercise (10 mins)
▪ Prevent previously
active namenode from
doing damage and
causing corruption
▪ Fencing mechanism
killing the namenode’s
process,
When all else fails…. STONITH
revoking its access to the
shared storage directory
disabling its network port
via a remote management
command.
HDFS Fencing
▪ Shared storage
Should be written only by one writer
Fencing to ensure that both NameNodes do not
write.
▪ Quorum Storage
JournalNodes permit only one writer.
Standby has to become the writer
Ensures that two writers cannot write
simultaneously
Fencing not a must.
Namenode memory requirements
26
Review Q’s
▪ https://www.ted.com/talks/del_harvey_the_s
trangeness_of_scale_at_twitter?language=e
n
Please prepare a presentation
Further reading
Read – Considerations
▪ Network latency
▪ Data center layout
Organized as racks
▪ Operation within rack is
faster
▪ Distance metric
▪ Network represented as
tree
Distance between two
nodes = sum of distances
to closest ancestor