跑mapreduce报错:Stack trace: ExitCodeException exitCode=1

(我在虚拟机有三台机器每台2g内存,aw-4是resourcemanager)
下面是执行pi时控制台的信息{{{Number of Maps = 5
Samples per Map = 200
Wrote input for Map #0
Wrote input for Map #1
Wrote input for Map #2
Wrote input for Map #3
Wrote input for Map #4
Starting Job
16/04/21 15:17:00 INFO client.RMProxy: Connecting to ResourceManager at aw-4/192.168.76.129:8032
16/04/21 15:17:02 INFO input.FileInputFormat: Total input paths to process : 5
16/04/21 15:17:02 INFO mapreduce.JobSubmitter: number of splits:5
16/04/21 15:17:03 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1461210284200_0003
16/04/21 15:17:04 INFO impl.YarnClientImpl: Submitted application application_1461210284200_0003
16/04/21 15:17:04 INFO mapreduce.Job: The url to track the job: http://aw-4:8088/proxy/application_1461210284200_0003/
16/04/21 15:17:04 INFO mapreduce.Job: Running job: job_1461210284200_0003
16/04/21 15:17:09 INFO mapreduce.Job: Job job_1461210284200_0003 running in uber mode : false
16/04/21 15:17:09 INFO mapreduce.Job: map 0% reduce 0%
16/04/21 15:17:09 INFO mapreduce.Job: Job job_1461210284200_0003 failed with state FAILED due to: Application application_1461210284200_0003 failed 2 times due to AM Container for appattempt_1461210284200_0003_000002 exited with exitCode: 1
For more detailed output, check application tracking page:http://aw-4:8088/proxy/application_1461210284200_0003/Then, click on links to logs of each attempt.
Diagnostics: Exception from container-launch.
Container id: container_1461210284200_0003_02_000001
Exit code: 1
Stack trace: ExitCodeException exitCode=1:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)
at org.apache.hadoop.util.Shell.run(Shell.java:455)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)


Container exited with a non-zero exit code 1
Failing this attempt. Failing the application.
16/04/21 15:17:09 INFO mapreduce.Job: Counters: 0
Job Finished in 9.195 seconds
java.io.FileNotFoundException: File does not exist: hdfs://aw-4:8020/user/root/QuasiMonteCarlo_1461223015778_1967346154/out/reduce-out
at org.apache.hadoop.hdfs.DistributedFileSystem$18.doCall(DistributedFileSystem.java:1122)
at org.apache.hadoop.hdfs.DistributedFileSystem$18.doCall(DistributedFileSystem.java:1114)
at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1114)
at org.apache.hadoop.io.SequenceFile$Reader.(SequenceFile.java:1750)
at org.apache.hadoop.io.SequenceFile$Reader.(SequenceFile.java:1774)
at org.apache.hadoop.examples.QuasiMonteCarlo.estimatePi(QuasiMonteCarlo.java:314)
at org.apache.hadoop.examples.QuasiMonteCarlo.run(QuasiMonteCarlo.java:354)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.examples.QuasiMonteCarlo.main(QuasiMonteCarlo.java:363)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:71)
at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:144)
at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
}}}-----------------------------------------------------------
**下面是resourcemanager里的log (与控制台信息类似)**
{{{2016-04-21 15:17:09,053 INFO org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl: Application application_1461210284200_0003 failed 2 times due to AM Container for appattempt_1461210284200_0003_000002 exited with exitCode: 1
For more detailed output, check application tracking page:http://aw-4:8088/proxy/application_1461210284200_0003/Then, click on links to logs of each attempt.
Diagnostics: Exception from container-launch.
Container id: container_1461210284200_0003_02_000001
Exit code: 1
Stack trace: ExitCodeException exitCode=1:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)
at org.apache.hadoop.util.Shell.run(Shell.java:455)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)


Container exited with a non-zero exit code 1
Failing this attempt. Failing the application.

2016-04-21 15:17:09,054 INFO org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl: application_1461210284200_0003 State change from FINAL_SAVING to FAILED
2016-04-21 15:17:09,054 WARN org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger: USER=root OPERATION=Application Finished - Failed TARGET=RMAppManager RESULT=FAILURE DESCRIPTION=App failed with state: FAILED PERMISSIONS=Application application_1461210284200_0003 failed 2 times due to AM Container for appattempt_1461210284200_0003_000002 exited with exitCode: 1
For more detailed output, check application tracking page:http://aw-4:8088/proxy/application_1461210284200_0003/Then, click on links to logs of each attempt.
Diagnostics: Exception from container-launch.
Container id: container_1461210284200_0003_02_000001
Exit code: 1
Stack trace: ExitCodeException exitCode=1:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:538)
at org.apache.hadoop.util.Shell.run(Shell.java:455)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)


Container exited with a non-zero exit code 1
Failing this attempt. Failing the application. APPID=application_1461210284200_0003
2016-04-21 15:17:09,054 INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler: Application appattempt_1461210284200_0003_000002 is done. finalState=FAILED
2016-04-21 15:17:09,057 INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.AppSchedulingInfo: Application application_1461210284200_0003 requests cleared
2016-04-21 15:17:09,056 INFO org.apache.hadoop.yarn.server.resourcemanager.RMAppManager$ApplicationSummary: appId=application_1461210284200_0003,name=QuasiMonteCarlo,user=root,queue=root.root,state=FAILED,trackingUrl=http://aw-4:8088/cluster/app/application_1461210284200_0003,appMasterHost=N/A,startTime=1461223024031,finishTime=1461223029051,finalStatus=FAILED
2016-04-21 15:17:10,052 INFO org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler: Null container completed...
}}}------------------------------------------------------------------------------
下面是我参考DX3-conf的自己的配置
**(我只粘贴了可能与这相关的)**
**在mapred-site.xml里:**
  {{{
mapreduce.task.io.sort.factor
64


mapreduce.map.sort.spill.percent
0.8


mapreduce.reduce.shuffle.parallelcopies
10


mapreduce.task.timeout
600000


mapreduce.client.submit.file.replication
1


mapreduce.job.reduces
1


mapreduce.task.io.sort.mb
30

yarn.app.mapreduce.am.resource.mb
200


yarn.app.mapreduce.am.resource.cpu-vcores
1


yarn.app.mapreduce.am.command-opts
-Djava.net.preferIPv4Stack=true -Xmx100m


mapreduce.map.java.opts
-Djava.net.preferIPv4Stack=true -Xmx100m


mapreduce.reduce.java.opts
-Djava.net.preferIPv4Stack=true -Xmx100m


mapreduce.map.memory.mb
200


mapreduce.map.cpu.vcores
1


mapreduce.reduce.memory.mb
200


mapreduce.reduce.cpu.vcores
1



}}}
**在yarn-site.xml里:**
{{{
yarn.scheduler.minimum-allocation-mb
50


yarn.scheduler.increment-allocation-mb
50


yarn.scheduler.maximum-allocation-mb
7168


yarn.nodemanager.resource.memory-mb
700


yarn.nodemanager.vmem-pmem-ratio
20


yarn.nodemanager.vmem-check-enabled
false

}}}_我已经听了练习直播课第一次,自己手动搭apache版本,一直报stack trace,参数调了很多次,也不知道如何解决。aw-4上是RM 没有给它nodemanager,必要进程开着的情况下 内存是:_
{{{ total used free shared buffers cached
Mem: 1869 850 1018 0 47 262
-/+ buffers/cache: 540 1329
Swap: 1023 0 1023
}}}_另外两台跑DN、NM情况是:_
{{{ total used free shared buffers cached
Mem: 1869 718 1150 0 28 142
-/+ buffers/cache: 547 1322
Swap: 1023 0 1023
}}}我觉得物理内存是足够的。
 
 
已邀请:
报错里 还有个 File does not exist 的问题 目前还没解决
执行命令yarn logs -applicationId application_1461210284200_0003
显示什么
yarn-site.xml配置成下面的值{{{
yarn.nodemanager.resource.memory-mb
1200
}}}

fish - Hadooper

yarn-site.xml中yarn.application.classpath配了什么?是否已经将hadoop的相关classpath都加进去?

fish - Hadooper

你的hadoop是什么版本的?

fish - Hadooper

请执行一下hadoop classpath,获得一个输出之后,将其拷贝下来。
然后,替换掉yarn.application.classpath中的配置,重启nodemanager,然后再提交任务试试。
hadoop classpath如下:/root/software/hadoop-2.6.0/etc/hadoop:/root/software/hadoop-2.6.0/share/hadoop/common/lib/*:/root/software/hadoop-2.6.0/share/hadoop/common/*:/root/software/hadoop-2.6.0/share/hadoop/hdfs:/root/software/hadoop-2.6.0/share/hadoop/hdfs/lib/*:/root/software/hadoop-2.6.0/share/hadoop/hdfs/*:/root/software/hadoop-2.6.0/share/hadoop/yarn/lib/*:/root/software/hadoop-2.6.0/share/hadoop/yarn/*:/root/software/hadoop-2.6.0/share/hadoop/mapreduce/lib/*:/root/software/hadoop-2.6.0/share/hadoop/mapreduce/*:/contrib/capacity-scheduler/*.jar
已经粘贴到配置中并重启了nm,**提交任务后又报了snappy本地库不可用**
{{{16/04/21 16:14:40 INFO mapreduce.Job: map 0% reduce 0%
16/04/21 16:15:16 INFO mapreduce.Job: Task Id : attempt_1461226425828_0001_m_000001_0, Status : FAILED
Error: java.lang.RuntimeException: native snappy library not available: this version of libhadoop was built without snappy support.
at org.apache.hadoop.io.compress.SnappyCodec.checkNativeCodeLoaded(SnappyCodec.java:64)
at org.apache.hadoop.io.compress.SnappyCodec.getCompressorType(SnappyCodec.java:133)
at org.apache.hadoop.io.compress.CodecPool.getCompressor(CodecPool.java:148)
at org.apache.hadoop.io.compress.CodecPool.getCompressor(CodecPool.java:163)
at org.apache.hadoop.mapred.IFile$Writer.(IFile.java:114)
at org.apache.hadoop.mapred.IFile$Writer.(IFile.java:97)
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.sortAndSpill(MapTask.java:1602)
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.flush(MapTask.java:1482)
at org.apache.hadoop.mapred.MapTask$NewOutputCollector.close(MapTask.java:720)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:790)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)

16/04/21 16:15:16 INFO mapreduce.Job: Task Id : attempt_1461226425828_0001_m_000003_0, Status : FAILED
}}}--------------------------------------------------------
attempt重复了几次,每次都报 Error: java.lang.RuntimeException: native snappy library not available: this version of libhadoop was built without snappy support
-**_ 最后_**
  map 100% reduce 100%
16/04/21 16:17:03 INFO mapreduce.Job: Job job_1461226425828_0001 failed with state FAILED due to: Task failed task_1461226425828_0001_m_000001
Job failed as tasks failed. failedMaps:1 failedReduces:0
 
去掉mapred-site.xml中{{{
mapreduce.map.output.compress.codec
org.apache.hadoop.io.compress.SnappyCodec
}}}的配置
谢谢两位老师,删掉这snappycodec配置后 提交任务可以跑成功了,   赞!

要回复问题请先登录注册