Turning safe mode on HA NameNodes
You can use the applicable dfsadmin command options to turn safe mode on for a single or both the active and standby NameNodes.
To turn safe mode on for both NameNodes, run
hdfs dfsadmin -safemode enter.
To turn safe mode on for a single NameNode, run
hdfs dfsadmin -fs hdfs://<host>:<port> -safemode enter