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會將自己至於安全模式?


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章