gpt4 book ai didi

hadoop - 如何减少 Hadoop Yarn Container 生成的日志量?

转载 作者:可可西里 更新时间:2023-11-01 16:39:04 24 4
gpt4 key购买 nike

我正在使用 Hadoop 2.7.3,使用 Yarn 进行一些 map reduce。每个容器生成的日志都是天文数字。明显使用的级别是 DEBUG。我想将日志级别提高到 INFO。

我的安装或多或少是默认安装。

我尝试修改 hadoop-yarn-server-nodemanager-*.jar 中的 container-log4j.properties,如 https://community.hortonworks.com/questions/98259/hdp-250-how-to-override-default-container-log4j-in.html 中所述但这没有帮助。我的每个容器的标准输出文件都很大……这很可能也是我的 map/reduce 速度如此之慢的原因。

有谁知道如何在我的 stdout 容器日志文件中将我的日志级别提高到 INFO?

这是我的标准输出之一的摘录:

~/hadoop/logs/userlogs/application_1501740469795_0001/container_1501740469795_0001_01_000001:1282> more stdout 08:08:55.337 [main] DEBUG org.apache.hadoop.metrics2.impl.MetricsSystemImpl - JvmMetrics, JVM related metrics etc. 08:08:55.348 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableCounterInt org.apache.hadoop.mapreduce.v2.app.metrics.MRAppMetrics.jobsSubmitted with annotation @org.apache.hadoop.metrics2.annotation.Metric(about=, sampleName=Ops, always=false, type=DEFAULT, value=[], valueName=Time) 08:08:55.355 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableCounterInt org.apache.hadoop.mapreduce.v2.app.metrics.MRAppMetrics.jobsCompleted with annotation @org.apache.hadoop.metrics2.annotation.Metric(about=, sampleName=Ops, always=false, type=DEFAULT, value=[], valueName=Time) 08:08:55.360 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableCounterInt org.apache.hadoop.mapreduce.v2.app.metrics.MRAppMetrics.jobsFailed with annotation @org.apache.hadoop.metrics2.annotation.Metric(about=, sampleName=Ops, always=false, type=DEFAULT, va lue=[], valueName=Time) 08:08:55.364 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableCounterInt org.apache.hadoop.mapreduce.v2.app.metrics.MRAppMetrics.jobsKilled with annotation @org.apache.hadoop.metrics2.annotation.Metric(about=, sampleName=Ops, always=false, type=DEFAULT, va lue=[], valueName=Time) 08:08:55.364 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableGaugeInt org.apache.hadoop.mapreduce.v2.app.metrics.MRAppMetrics.jobsPreparing with annotation @org.apache.hadoop.metrics2.annotation.Metric(about=, sampleName=Ops, always=false, type=DEFAULT, v alue=[], valueName=Time) 08:08:55.365 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableGaugeInt org.apache.hadoop.mapreduce.v2.app.metrics.MRAppMetrics.jobsRunning with annotation @org.apache.hadoop.metrics2.annotation.Metric(about=, sampleName=Ops, always=false, type=DEFAULT, val ue=[], valueName=Time) 08:08:55.365 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableCounterInt org.apache.hadoop.mapreduce.v2.app.metrics.MRAppMetrics.mapsLaunched with annotation @org.apache.hadoop.metrics2.annotation.Metric(about=, sampleName=Ops, always=false, type=DEFAULT, value=[], valueName=Time) 08:08:55.365 [main] DEBUG org.apache.hadoop.metrics2.lib.MutableMetricsFactory - field org.apache.hadoop.metrics2.lib.MutableCounterInt org.apache.hadoop.mapreduce.v2.app.metrics.MRAppMetrics.mapsCompleted with annotation @org.apache.hadoop.metrics2.annotation.Metric(about=, sampleName=Ops, always=false, type=DEFAULT, value=[], valueName=Time) ...

感谢您的帮助。

最佳答案

问题是我忽略了发送到 stderr 的警告。

SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/hadoop/HADOOP_DATA-2.7.3/yarnData/usercache/jj/appcache/application_1501771750571_0001/filecache/11/map-reducer-job.jar/lib/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/hadoop/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

我将我的作业打包在一个 Jar 文件中,其所需的库位于子目录 lib 中。我在它的库中包含了一个额外的 slf4j 绑定(bind)。

解决方案是从我的作业 jar 文件中删除第二个 slf4j 绑定(bind)。

在此之后没有混淆,使用的跟踪级别是定义的级别,即 INFO。 !!!

关于hadoop - 如何减少 Hadoop Yarn Container 生成的日志量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45465329/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com