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

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.

主站蜘蛛池模板: 横山县| 荃湾区| 卓尼县| 宁武县| 连云港市| 平定县| 会昌县| 阳高县| 新蔡县| 乌审旗| 高州市| 四平市| 鄯善县| 临沭县| 荥经县| 大姚县| 永川市| 襄汾县| 靖江市| 文山县| 霍州市| 共和县| 济宁市| 武邑县| 上栗县| 水城县| 乃东县| 哈密市| 平罗县| 自贡市| 冀州市| 辽源市| 通州区| 清苑县| 青铜峡市| 班戈县| 阳信县| 江口县| 若尔盖县| 华宁县| 湟中县|