0
0
Hadoopdata~10 mins

HDFS high availability in Hadoop - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start the HDFS NameNode in high availability mode.

Hadoop
hdfs --daemon start [1]
Drag options to blanks, or click blank then click option'
Asecondarynamenode
Bjournalnode
Cdatanode
Dnamenode
Attempts:
3 left
💡 Hint
Common Mistakes
Starting datanode instead of namenode
Starting secondarynamenode which is not used in HA
Starting journalnode which is for shared edits
2fill in blank
medium

Complete the command to check the status of the HDFS high availability setup.

Hadoop
hdfs haadmin -[1]
Drag options to blanks, or click blank then click option'
AgetServiceState
Bfailover
CtransitionToActive
DrefreshNodes
Attempts:
3 left
💡 Hint
Common Mistakes
Using failover which triggers failover instead of checking status
Using transitionToActive which changes state
Using refreshNodes which refreshes datanode info
3fill in blank
hard

Fix the error in the command to perform a manual failover in HDFS HA.

Hadoop
hdfs haadmin -failover [1]
Drag options to blanks, or click blank then click option'
Ann1
Bnn2
Attempts:
3 left
💡 Hint
Common Mistakes
Providing two NameNode names causing syntax error
Using the standby NameNode as source incorrectly
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps each NameNode to its HA state.

Hadoop
states = {nn: 'hdfs haadmin -getServiceState ' + nn for nn in {{BLANK_2}}
Drag options to blanks, or click blank then click option'
Ann
B['nn1', 'nn2']
C['nn1', 'nn2', 'nn3']
Dnamenodes
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong variable name in the comprehension
Using an incorrect list of NameNodes
5fill in blank
hard

Fill all three blanks to create a dictionary of NameNodes with their HA states, filtering only active ones.

Hadoop
active_nodes = { [1]: 'hdfs haadmin -getServiceState ' + [2] for [3] in ['nn1', 'nn2'] if 'hdfs haadmin -getServiceState ' + [3] == 'active' }
Drag options to blanks, or click blank then click option'
Ann
Dnode
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names inconsistently
Not calling the getServiceState command correctly