- Hadoop Real-World Solutions Cookbook(Second Edition)
- Tanmay Deshpande
- 234字
- 2021-07-09 20:02:48
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.
- WOW!Illustrator CS6完全自學寶典
- Hands-On Linux for Architects
- 可編程控制器技術應用(西門子S7系列)
- 讓每張照片都成為佳作的Photoshop后期技法
- INSTANT Autodesk Revit 2013 Customization with .NET How-to
- Blender 3D Printing by Example
- Machine Learning with Apache Spark Quick Start Guide
- 單片機C語言應用100例
- 面向對象程序設計綜合實踐
- 工業機器人維護與保養
- INSTANT Adobe Story Starter
- 3ds Max造型表現藝術
- 中國戰略性新興產業研究與發展·數控系統
- Serverless Design Patterns and Best Practices
- 項目實踐精解:C#核心技術應用開發