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

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.

主站蜘蛛池模板: 合水县| 亳州市| 福安市| 九龙城区| 孝感市| 沙田区| 上虞市| 梅州市| 马尔康县| 北辰区| 延寿县| 灵寿县| 盖州市| 敖汉旗| 高碑店市| 额敏县| 屏山县| 桃江县| 镇康县| 林周县| 新营市| 汽车| 怀来县| 盐山县| 来凤县| 沁阳市| 阜阳市| 正宁县| 瓦房店市| 甘洛县| 山西省| 黄冈市| 固原市| 华安县| 绥中县| 湖南省| 乃东县| 萍乡市| 两当县| 张家川| 洛宁县|