官术网_书友最值得收藏!

Entering and exiting from the safe mode in a Hadoop cluster

Sometimes, due to an unclear filesystem image state, the Hadoop cluster goes into safemode. In this recipe, we will see how to enter and exit from safemode.

How to do it...

Safemode is an HDFS state that does not allow any new writes to the filesystem. It also does not replicate or delete any blocks from the filesystem. In case you want to make any configuration changes to your cluster, you can put the system into safemode. Here is a command to enter the system into safemode:

hdfs dfsadmin -safemode enter

Now, if you try to make any writes to HDFS, it will not allow you do so. You can perform cluster maintenance and once this is done, you can switch off safemode:

hdfs dfsadmin -safemode leave

In case you are not aware of whether safemode is ON or OFF, you can get its status by executing the following command:

hdfs dfsadmin -safemode get

How it works...

Generally, safemode is enabled automatically for NameNode on startup. It then tries to get the state of the filesystem from FSImage and EditLogs. Namenode waits until datanodes start reporting the block status of inpidual nodes. safemode is automatically disabled when datanodes report the availability of most of the blocks.

If we enter into safemode manually, we need to disable it manually. It won't be disabled automatically.

主站蜘蛛池模板: 且末县| 大姚县| 扎兰屯市| 卢龙县| 龙口市| 北辰区| 城固县| 绥江县| 通山县| 瓦房店市| 磐安县| 青海省| 商南县| 麦盖提县| 孝义市| 射洪县| 平泉县| 平陆县| 芜湖市| 富锦市| 九寨沟县| 灵寿县| 长丰县| 英超| 万山特区| 嵊州市| 旬阳县| 个旧市| 张家口市| 辽源市| 西吉县| 陆河县| 舟山市| 九龙县| 伊金霍洛旗| 德令哈市| 玛多县| 土默特左旗| 福州市| 阳朔县| 康乐县|