我们正在运行一个使用 yarn 作为资源管理器的 spark streaming 作业,注意到这两个目录在数据节点上被填满,当我们只运行几分钟时空间就用完了
/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>
最佳答案
如果主要问题是空间不足,请尝试为 yarn 属性“yarn.nodemanager.localizer.cache.target-size-mb”设置一个较低的值。默认情况下,这是 10240 MB(10GB)。
至于没有触发自动清理,这可能是由于(或至少相关)在 Yarn 2.7.1 上报告的这个 Unresolved 错误:https://issues.apache.org/jira/browse/YARN-4540
关于hadoop - yarn : Automatic clearing of filecache & usercache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41539659/