问题描述
我尝试将文件从本地磁盘复制到中的参数 dfs.namenode.safemode.threshold-pct p>
对于小块/开发群集,只有很少块的情况下 - 将此参数设置为低于其默认值 0.9999f $ c $价值。否则,1个丢失的块可能导致系统以安全模式挂起。
I tried copying files from my local disk to hdfs . At first it gave SafeModeException. While searching for solution I read that the problem does not appear if one executes same command again. So I tried again and it didn't gave exception.
hduser@saket:/usr/local/hadoop$ bin/hadoop dfs -copyFromLocal /tmp/gutenberg/ /user/hduser/gutenberg copyFromLocal: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/hduser/gutenberg. Name node is in safe mode. hduser@saket:/usr/local/hadoop$ bin/hadoop dfs -copyFromLocal /tmp/gutenberg/ /user/hduser/gutenberg
Why is this happening?. Should I keep safemode off by using this code?
hadoop dfs -safemode leave
NameNode is in safemode until configured percent of blocks reported to be online by the data nodes. It can be configured by parameter dfs.namenode.safemode.threshold-pct in the hdfs-site.xml
For small / development clusters, where you have very few blocks - it makes sense to make this parameter lower then its default 0.9999f value. Otherwise 1 missing block can lead to system to hang in safemode.
这篇关于SafeModeException:名称节点处于安全模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!