hadoop的安全模式

1.概念

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. ASafemode 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

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


2. 安全模式,不允许hdfs数据有更新,mapreduce任务都会失败

可以通过bin/hadoop dfsadmin -safemode leave 来关闭此状态。

你可能感兴趣的:(hadoop的安全模式)