【发布时间】:2015-04-08 22:18:20
【问题描述】:
我的系统中安装了 hive 和 hadoop。
这是我的 hdfs-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
如果我执行 bin/start-all.sh 并转到我的配置单元并运行选择查询,我会收到错误:
The ratio of reported blocks 0.0000 has not reached the threshold 0.9990. Safe mode will be turned off automatically.
如果我等待一段时间并再次运行 hive 查询,它会起作用。
我读到安全模式阈值是使用属性设置的:dfs.namenode.safemode.threshold-pct
我在 hdfs-site.xml 中添加了该属性
<property>
<name>dfs.namenode.safemode.threshold-pct</name>
<value>0.500f</value>
</property>
我再次启动了所有 hadoop 节点,并运行 hive 查询,但我仍然遇到同样的错误
The ratio of reported blocks 0.0000 has not reached the threshold 0.9990. Safe mode will
这意味着要么我的 xml 错误,要么我必须执行其他操作才能实际加载 hdfs-site.xml。
谁能告诉我我做错了什么?
【问题讨论】:
-
更改后是否重启了hadoop。
-
您的集群中有多少个数据节点?
-
是的,我已经重新启动了。我在伪分布式模式下运行 1 个数据节点