Complete the code to start the HDFS NameNode in high availability mode.
hdfs --daemon start [1]The NameNode is the master node in HDFS and must be started to enable high availability.
Complete the command to check the status of the HDFS high availability setup.
hdfs haadmin -[1]The getServiceState option shows if a NameNode is active or standby in HA.
Fix the error in the command to perform a manual failover in HDFS HA.
hdfs haadmin -failover [1]The failover command requires the source NameNode only, not two arguments.
Fill both blanks to create a dictionary comprehension that maps each NameNode to its HA state.
states = {nn: 'hdfs haadmin -getServiceState ' + nn for nn in {{BLANK_2}}The command uses each NameNode name to get its state, iterating over the list of two NameNodes.
Fill all three blanks to create a dictionary of NameNodes with their HA states, filtering only active ones.
active_nodes = { [1]: 'hdfs haadmin -getServiceState ' + [2] for [3] in ['nn1', 'nn2'] if 'hdfs haadmin -getServiceState ' + [3] == 'active' }The comprehension maps each NameNode to its state, iterating over the list and filtering for active nodes only.