BornZhu 2017-05-05
使用window提交到Sparkcluster中出现下面错误:
Exitcode:1
Exceptionmessage:/bin/bash:line0:fg:nojobcontrol
Stacktrace:ExitCodeExceptionexitCode=1:/bin/bash:line0:fg:nojobcontrol
atorg.apache.hadoop.util.Shell.runCommand(Shell.java:538)
atorg.apache.hadoop.util.Shell.run(Shell.java:455)
atorg.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:715)
atorg.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:212)
atorg.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
atorg.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
atjava.util.concurrent.FutureTask.run(FutureTask.java:262)
atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
atjava.lang.Thread.run(Thread.java:745)
Containerexitedwithanon-zeroexitcode1
困扰了一个星期,各种百度,google,始终不能解决问题
最后通过EClipse开了个小程序测试中发现,mvn引用的
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-yarn_2.11</artifactId>
<version>2.1.0</version>
<scope>compile</scope>
</dependency>
此jar包与spark下jars的jar包发送冲突,删除掉此引用,问题解决!
在此记录一下
在运行程序的时候,发现程序总会将依赖的jar全部打包成zip,并上传到hdfs,耽误时间
自己在hdfs下将spark的jars打包成zip,并上传到hdfs
在程序中使用
conf.set("spark.yarn.archive","hdfs:////input/spark/spark-jars.zip")
设置即可