问题
We have a spark streaming application running on HDFS 2.7.3 with Yarn as the resource manager....while running the application .. these two folders
/tmp/hadoop/data/nm-local-dir/filecache
/tmp/hadoop/data/nm-local-dir/filecache
are filling up and hence the disk .....
so from my research found that configuring these two properties in yarn-site.xml will help
<property>
<name>yarn.nodemanager.localizer.cache.cleanup.interval-ms</name>
<value>2000</value>
</property>
<property>
<name>yarn.nodemanager.localizer.cache.target-size-mb</name>
<value>2048</value>
</property>
i have configured them on each namenode and masternode ..and restarted the yarn on masternode ..but still doesn't seem to help ...please let me know if i'm missing anything ...while doing the configuration changes ...this is the yarn-site.xml
<!-- Site specific YARN configuration properties -->
<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.local-dirs</name>
<value>file:///tmp/hadoop/data/nm-local-dir</value>
</property>
<property>
<name>yarn.nodemanager.localizer.cache.cleanup.interval-ms</name>
<value>2000</value>
</property>
<property>
<name>yarn.nodemanager.localizer.cache.target-size-mb</name>
<value>2048</value>
</property>
</configuration>
Update: i tried with this property but still doesn't clean up and disk is getting full
<property>
<name>yarn.nodemanager.local-dirs</name>
<value>file:///tmp/hadoop/data/nm-local-dir,file:///tmp/hadoop/data/nm-local-dir/filecache,file:///tmp/hadoop/data/nm-local-dir/usercache</value>
</property>
回答1:
You say that the folder "/tmp/hadoop/data/nm-local-dir/filecache" is filling up so should be cleaned up periodically.
But the parameter you specified for the cleanup, specifically "yarn.nodemanager.localizer.cache.cleanup.interval-ms" and "yarn.nodemanager.localizer.cache.target-size-mb" is applicable to "/tmp/hadoop/data/nm-local-dir/filecache" but the "yarn.nodemanager.local-dirs" value of "file:///tmp/hadoop/data/nm-local-dir" does not include the "filecache" in the path. Fix the value "file:///tmp/hadoop/data/nm-local-dir" to "file:///tmp/hadoop/data/nm-local-dir/filecache".
来源:https://stackoverflow.com/questions/41575724/yarn-yarn-site-xml-changes-not-taking-effect