What is Safe Mode in Hadoop NameNode and How to Exit It

When the NameNode is in safe mode, it means that it is not actively processing data and is in a "read-only" state. This is typically done when the NameNode is starting up, to ensure that it has a consistent view of the file system metadata before allowing clients to start modifying it.

Safe mode can also be entered manually, for example, if you suspect there may be a problem with the file system metadata and you want to prevent further changes until it can be resolved.

While the NameNode is in safe mode, you will not be able to perform any data operations (such as creating or modifying files) on the Hadoop cluster. You can check the status of safe mode by running the following command: hdfs dfsadmin -safemode get.

To exit safe mode, you can run the following command: hdfs dfsadmin -safemode leave.

It's important to only exit safe mode when you are confident that the file system metadata is consistent and that you will not cause data loss. If there are any issues with the file system, it's recommended to first resolve them before exiting safe mode.

 

Previous Post Next Post