伪分布式模式下设置mapred.map.tasks时出错

发布于 2024-12-19 13:57:46 字数 765 浏览 0 评论 0原文

正如此处所建议的,我正在运行hadoop在伪分布式模式下使用以下 mapred-site.xml 文件。该作业在 4 核机器上运行。

<configuration>
   <property>
        <name>mapred.job.tracker</name>
        <value>localhost:9001</value>  
   </property>
   <property>
     <name>mapred.map.tasks</name> 
     <value>4</value> 
  </property>
  <property>
     <name>mapred.reduce.tasks</name> 
     <value>4</value> 
  </property>

</configuration>

我收到以下错误:

报告区块比例1.0000已达到阈值0.9990。

这是什么原因呢。如何解决这个问题?

As suggested here, I am running hadoop in pseudodistributed mode with the following mapred-site.xml file. The job is running on a 4 core machine.

<configuration>
   <property>
        <name>mapred.job.tracker</name>
        <value>localhost:9001</value>  
   </property>
   <property>
     <name>mapred.map.tasks</name> 
     <value>4</value> 
  </property>
  <property>
     <name>mapred.reduce.tasks</name> 
     <value>4</value> 
  </property>

</configuration>

I am getting the following error:

The ratio of reported blocks 1.0000 has reached the threshold 0.9990.

What is the reason for this. How to fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

三生殊途 2024-12-26 13:57:46

这不是问题,而是hadoop启动过程中的正常过程。

安全模式是 HDFS 的一种状态,其中文件系统以只读方式挂载;不执行复制,也不能创建或删除文件。这是在 NameNode 启动时自动输入的,以便在 NameNode 确定哪些块复制不足等之前,允许所有 DataNode 有时间与 NameNode 签入并宣布它们持有哪些块。

您还可以查看什么是安全模式 在此页面

NameNode 会等待特定百分比的块出现并被占用,该百分比默认由 hdfs-default.xml 中的 dfs.safemode.threshold.pct 参数设置。但您可以在 hdfs-site.xml 中更改它。

所以

<property>
  <name>dfs.safemode.threshold.pct</name>
  <value>0.999f</value>
  <description>
    Specifies the percentage of blocks that should satisfy 
    the minimal replication requirement defined by dfs.replication.min.
    Values less than or equal to 0 mean not to wait for any particular
    percentage of blocks before exiting safemode.
    Values greater than 1 will make safe mode permanent.
  </description>
</property>

你会看到日志以 0.9990 结尾

The ratio of reported blocks 1.0000 has reached the threshold 0.9990.

It's not a problem, but a normal procedure during hadoop startup.

Safemode is an HDFS state in which the file system is mounted read-only; no replication is performed, nor can files be created or deleted. This is automatically entered as the NameNode starts, to allow all DataNodes time to check in with the NameNode and announce which blocks they hold, before the NameNode determines which blocks are under-replicated, etc.

You can also see what is Safemode in this page.

The NameNode waits until a specific percentage of the blocks are present and accounted-for, the percentage is set by dfs.safemode.threshold.pct parameter in hdfs-default.xml by default. But you can change it in hdfs-site.xml.

It's

<property>
  <name>dfs.safemode.threshold.pct</name>
  <value>0.999f</value>
  <description>
    Specifies the percentage of blocks that should satisfy 
    the minimal replication requirement defined by dfs.replication.min.
    Values less than or equal to 0 mean not to wait for any particular
    percentage of blocks before exiting safemode.
    Values greater than 1 will make safe mode permanent.
  </description>
</property>

So you see the log ends with 0.9990

The ratio of reported blocks 1.0000 has reached the threshold 0.9990.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文