Hadoop Safe mode

hadoop fs -rmr /hypertable
rmr: org.apache.hadoop.dfs.SafeModeException: Cannot delete /hypertable. Name node is in safe mode.
#### turn off hadoop safe mode firstly

hadoop dfsadmin -safemode leave

hadoop fs -rmr /hypertable
#开启safe mode
hadoop dfsadmin -safemode enter

## hadoop safe mode desc

During start up Namenode loads the filesystem state from fsimage and edits log file. It then waits for datanodes to report their blocks so that it does not prematurely start replicating the blocks though enough replicas already exist in the cluster. During this time Namenode stays in safemode. A Safemode  for Namenode is essentially a read-only mode for the HDFS cluster, where it does not allow any modifications to filesystem or blocks. Normally Namenode gets out of safemode automatically at the beginning. If required, HDFS could be placed in safemode explicitly using 'bin/hadoop dfsadmin -safemode' command. Namenode front page shows whether safemode is on or off. A more detailed description and configuration is maintained as JavaDoc for setSafeMode(). 

在name node 启动的时候,它会从fsimage载入文件系统状态并编辑日志文件.它将等待datanode来汇报他们的数据块,所以他不会过早的开始复制数据,尽管有足够复制那些存在于集群的数据. 在这个时间段,name node将置于安全模式.


在添加硬盘或者重做分区的时候,hadoop会将自己至于安全模式?


你可能感兴趣的:(apache,hadoop,UP)