Hadoop 资源管理器将应用程序信息存储多长时间?

How long does the Hadoop Resource Manager store the application information?

我们使用官方 REST api 从 Hadoop 资源管理器中读取各种用户和应用程序的资源使用情况。我们的问题是应用程序历史持续时间不够长,因此它 returns -1 已用内核、内存和容器的值。

我们想延长 yarn 存储数据的持续时间,但我们不知道在哪里设置值。

您应该检查您的 mapred-site.xml 并查看 mapreduce.jobhistory.max-age-ms。如所述:

https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml

Job history files older than this many milliseconds will be deleted when the history cleaner runs. Defaults to 604800000 (1 week).

如果要读取资源使用情况,应考虑使用作业历史记录服务器的作业 API 和作业计数器 API。 RM REST APIs 显示瞬时使用量而不是累积使用量。

https://hadoop.apache.org/docs/stable/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/HistoryServerRest.html#Job_API

https://hadoop.apache.org/docs/stable/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/HistoryServerRest.html#Job_Counters_API