在单机模式下执行成功的spark程序,在yarn上面就报错。异常信息如下:

 // :: INFO DAGScheduler: Completed ResultTask(, )
// :: INFO DAGScheduler: Stage (saveAsTextFile at FileUtil.scala:) finished in 0.179 s
// :: INFO SparkContext: Job finished: saveAsTextFile at FileUtil.scala:, took 0.331739293 s
// :: INFO TaskSetManager: Finished TID in ms on localhost (progress: /)
// :: INFO TaskSchedulerImpl: Removed TaskSet 2.0, whose tasks have all completed, from pool
// :: INFO ApplicationMaster: finishApplicationMaster with SUCCEEDED
Exception in thread "main" java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:)
at org.apache.spark.deploy.yarn.ApplicationMaster.waitForSparkContextInitialized(ApplicationMaster.scala:)
at org.apache.spark.deploy.yarn.ApplicationMaster.run(ApplicationMaster.scala:)
at org.apache.spark.deploy.yarn.ApplicationMaster$$anonfun$main$.apply$mcV$sp(ApplicationMaster.scala:)
at org.apache.spark.deploy.SparkHadoopUtil$$anon$.run(SparkHadoopUtil.scala:)
at org.apache.spark.deploy.SparkHadoopUtil$$anon$.run(SparkHadoopUtil.scala:)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:)
at org.apache.spark.deploy.SparkHadoopUtil.runAsSparkUser(SparkHadoopUtil.scala:)
at org.apache.spark.deploy.yarn.ApplicationMaster$.main(ApplicationMaster.scala:)
at org.apache.spark.deploy.yarn.ApplicationMaster.main(ApplicationMaster.scala)
// :: INFO ApplicationMaster: AppMaster received a signal.
// :: INFO ApplicationMaster: Deleting staging directory .sparkStaging/application_1408004797389_0007

从日志上面分析,job执行成功了。但貌似是没有获取到yarn返回的结果信息。

debug后发现是下面的问题:

spark-submit --class org.andy.hadoop.ETL --master yarn-cluster  ../lib/rdbms-0.0.-SNAPSHOT-jar-with-dependencies.jar /dest/ETL2

job以yarn-cluster形式执行,但代码中初始化的为:

  var conf = new SparkConf().setAppName("testFilter").setMaster("local")
var sc = new SparkContext(conf)

以local的形式初始化的。所以接收不到yarn的返回结果。修改后:

     var conf = new SparkConf().setAppName("testFilter").setMaster("yarn-cluster")
var sc = new SparkContext(conf)

执行成功!

spark在yarn-cluster上面执行报错的更多相关文章

  1. 执行Spark运行在yarn上的命令报错 spark-shell --master yarn-client

    1.执行Spark运行在yarn上的命令报错 spark-shell --master yarn-client,错误如下所示: // :: ERROR SparkContext: Error init ...

  2. Spark On Yarn Cluster生产环境下JVM的OOM和Stack Overflow问题

    1.Spark on Yarn下JVM的OOM问题及解决方式 2.Spark中Driver的Stack Overflow的问题及解决方式 Spark on Yarn cluster mode: 此时有 ...

  3. oracle创建包后执行报错:object omgmig.test_package is invalid.

    今天学习了一下oracle的包的写法,然后碰到这么个问题.包声明和包主体都正确,但是就是执行报错:object omgmig.test_package is invalid. 这是会报错的sql,看起 ...

  4. salt执行报错一例

    执行报错: 查看服务端日志: 认证有问题 重新认证吧!!! minion端: [root@super66 ~]# cd /etc/salt/[root@super66 salt]# lsminion ...

  5. Ubuntu下sh *.sh使用==操作符执行报错

    ----<鸟哥的Linux私房菜--基础篇>学习笔记 ubuntu默认的sh是连接到dash,而我们写shell脚本时使用的时bash.bash和dash在一些方面是不兼容的.因此执行同一 ...

  6. windows中修改catalina.sh上传到linux执行报错This file is needed to run this program解决

    windows中修改catalina.sh上传到linux执行报错This file is needed to run this program解决 一.发现问题 由于tomcat内存溢出,在wind ...

  7. apscheduler 执行报错No handlers could be found for logger "apscheduler.executors.default

    执行报错如下: No handlers could be found for logger "apscheduler.executors.default 解决: 加入日志,查看具体报错,载根 ...

  8. SQL server 维护计划中 “清除维护任务” 执行报错

    SQL server 维护计划中 “清除维护任务” 执行报错,错误如下: 执行查询“EXECUTE master.dbo.xp_delete_file 0,N'',N'',N'2019...”失败,错 ...

  9. scala的trait执行报错: 错误: 找不到或无法加载主类 cn.itcast.scala.`trait`

    scala的trait执行报错: 错误: 找不到或无法加载主类 cn.itcast.scala.`trait`.Children 原因:包名写成了trait,与trait关键字重名了: package ...

随机推荐

  1. Input.GetAxis 获取轴

    static function GetAxis (axisName : string) : float Description描述 Returns the value of the virtual a ...

  2. Architects Must Be Hands On

     Architects Must Be Hands On John Davies A good ARCHiTECT SHould lEAd By ExAMplE. He (or she) shoul ...

  3. AI学习笔记

    人人都是产品经理,继续设计课程啦啦啦啦 ADOBE: ps, ai, fl, dw, fw, ae, pr, id   COREL: painter coreldraw   autodesk: 三维: ...

  4. sed `grep` 查找并替换

    sed "s/libletvwatermark/libletv_watermark/" `grep -rl libletvwatermark` grep [options] 3.主 ...

  5. 【Java】Java_18 方法

    方法(Method) 设计方法的原则:方法的本意是功能块,就是实现某个功能的语句块的集合.   我们设计方法的时候,最好保持方法的原子性,就是一个方法只完成1个功能,这样利于我们后期的扩展 方法的要点 ...

  6. LoadRunner lr_eval_string() 函数使用及LR中变量、参数的简单使用

    lr_eval_string() 函数的主要作用:返回脚本中的一个参数当前的值, 返回值类型:char 一般多用在调试脚本时输出参数的值.具体用法如下:lr_output_message(" ...

  7. winform对话框拖拽显示文件路径的问题

    allow drop=true; dragEnter dragDrop vs管理员账户拖拽会失败

  8. mariadb在线热备份做主从

    yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noar ...

  9. Newtonsoft.Json之JArray, JObject, JProperty,JValue

    JObject staff = new JObject(); staff.Add(new JProperty("Name", "Jack")); staff.A ...

  10. OpenCV for Python 学习笔记 三

    给源图像增加边界 cv2.copyMakeBorder(src,top, bottom, left, right ,borderType,value) src:源图像 top,bottem,left, ...