【问题标题】:Yarn : Automatic clearing of filecache & usercacheYarn:自动清除文件缓存和用户缓存
【发布时间】:2017-02-10 13:40:16
【问题描述】:

我们正在运行一个使用 yarn 作为资源管理器的 spark 流作业,注意到这两个目录在数据节点上被填满,当我们只运行几分钟时,我们的空间就用完了

/tmp/hadoop/data/nm-local-dir/filecache

/tmp/hadoop/data/nm-local-dir/filecache

这些目录没有被自动清除,根据我的研究发现这个属性需要设置,yarn.nodemanager.localizer.cache.cleanup.interval-ms

即使在设置后..它不会自动清除任何帮助将不胜感激

<configuration>
    ~
    ~   <property>
    ~       <name>yarn.nodemanager.aux-services</name>
    ~       <value>mapreduce_shuffle</value>
    ~   </property>
    ~
    ~   <property>
    ~       <name>yarn.resourcemanager.hostname</name>
    ~       <value>hdfs-name-node</value>
    ~   </property>
    ~
    ~   <property>
    ~       <name>yarn.nodemanager.resource.memory-mb</name>
    ~       <value>16384</value>
    ~   </property>
    ~
    ~   <property>
    ~       <name>yarn.nodemanager.resource.cpu-vcores</name>
    ~       <value>6</value>
    ~   </property>
    ~
    ~   <property>
    ~       <name>yarn.scheduler.maximum-allocation-mb</name>
    ~       <value>16384</value>
    ~   </property>
         <property>
    ~       <name>yarn.nodemanager.localizer.cache.cleanup.interval-ms</name>
    ~       <value>3000</value>
    ~   </property>
    ~
    ~   <!-- Needs to be explicitly set as part of a workaround for YARN-367.
    ~      | If changing this property, you must also change the
    ~      | hadoop.tmp.dir property in hdfs-site.xml. This location must always
    ~      | be a subdirectory of the location specified in hadoop.tmp.dir. This
    ~      | affects all versions of Yarn 2.0.0 through 2.7.3+. -->
    ~   <property>
    ~       <name>yarn.nodemanager.local-dirs</name>
    ~       <value>file:///tmp/hadoop/data/nm-local-dir</value>
    ~   </property>
    ~
    ~ </configuration>

【问题讨论】:

    标签: hadoop spark-streaming hadoop-yarn


    【解决方案1】:

    如果主要问题是空间不足,请尝试为 yarn 属性“yarn.nodemanager.localizer.cache.target-size-mb”设置较低的值。默认为 10240 MB(10GB)。

    至于没有触发自动清理,这可能是由于(或至少与)有关 Yarn 2.7.1 上报告的这个未解决的错误:https://issues.apache.org/jira/browse/YARN-4540

    【讨论】:

      【解决方案2】:

      你的缓存清理间隔很好,但是由于本地目录在/tmp,它可能会很快被填满,通常/tmp 的空间会更少。我的建议是将您的yarn.nodemanager.local-dirs 更改为任何存储磁盘,例如/u01

      yarn.nodemanager.localizer.cache.cleanup.interval-ms 的推荐值为60000010 mins

      【讨论】:

      • 感谢您的评论布鲁斯即使我指向不同的目录..它也被填满了......我的问题是为什么自动清理没有开始......如果我们能解决这个问题缓存指向的目录不会是问题...
      猜你喜欢
      • 2017-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多