Hortonworks 中有关纱线的字数示例失败

Posted

技术标签:

【中文标题】Hortonworks 中有关纱线的字数示例失败【英文标题】:Wordcount example on yarn in Hortonworks failing 【发布时间】:2015-02-28 16:06:49 【问题描述】:

我有带有 Hadoop 2.2.0 的 Hortonworks Sandbox,并在沙箱上安装了 Apache-spark 技术预览版。

虽然我可以在本地模式下运行 Spark Java 示例,但我无法在 yarn-client 模式下运行 Java 示例。

以下是我用于执行的步骤:

    在 Eclipse IDE 中,我创建了一个 Java 项目,并在 src 目录下创建了一个文件 JavaWordCount,代码取自 Apache spark 附带的示例示例。

    然后我使用 Eclipse->export ->作为 jar 创建了 jar,并将该 jar 文件保存在我的本地系统中。

    然后在终端上我进入 spark 主目录并给出以下命令:

    [train@sandbox spark-1.2.0.2.2.0.0-82-bin-2.6.0.2.2.0.0-2041]$ b**in/spark-submit --class JavaWordCount --master yarn-client  --num-executors 1 --driver-memory 512m  --executor-memory 512m --executor-cores 1    /home/train/Desktop/sparkwc3.jar /README.md /out1
    

    我的文件在 hdfs 上的位置。

    我收到以下错误:

    15/02/28 11:04:02 ERROR cluster.YarnClientClusterScheduler: Lost executor 2 on sandbox.hortonworks.com: remote Akka client disassociated
    15/02/28 11:04:02 INFO scheduler.TaskSetManager: Re-queueing tasks for 2 from TaskSet 0.0
    15/02/28 11:04:02 WARN scheduler.TaskSetManager: Lost task 0.3 in stage 0.0 (TID 3, sandbox.hortonworks.com): ExecutorLostFailure (executor 2 lost)
    15/02/28 11:04:02 ERROR scheduler.TaskSetManager: Task 0 in stage 0.0 failed 4 times; aborting job
    15/02/28 11:04:02 INFO cluster.YarnClientClusterScheduler: Removed TaskSet 0.0, whose tasks have all completed, from pool 
    15/02/28 11:04:02 ERROR cluster.YarnClientSchedulerBackend: Asked to remove non-existent executor 2
    15/02/28 11:04:02 WARN remote.ReliableDeliverySupervisor: Association with remote system [akka.tcp://sparkExecutor@sandbox.hortonworks.com:34111] has failed, address is now gated for [5000] ms. Reason is: [Disassociated].
    15/02/28 11:04:02 INFO cluster.YarnClientClusterScheduler: Cancelling stage 0
    15/02/28 11:04:02 INFO scheduler.DAGScheduler: Job 0 failed: collect at JavaWordCount.java:68, took 20.451136 s
    Exception in thread "main" org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3 in stage 0.0 (TID 3, sandbox.hortonworks.com): ExecutorLostFailure (executor 2 lost)
    Driver stacktrace:
    at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$failJobAndIndependentStages(DAGScheduler.scala:1214)
    at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1203)
    at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1202)
    at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
    at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
    at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:1202)
    at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:696)
    at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:696)
    at scala.Option.foreach(Option.scala:236)
    at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:696)
    at org.apache.spark.scheduler.DAGSchedulerEventProcessActor$$anonfun$receive$2.applyOrElse(DAGScheduler.scala:1420)
    at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
    at org.apache.spark.scheduler.DAGSchedulerEventProcessActor.aroundReceive(DAGScheduler.scala:1375)
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
    at akka.actor.ActorCell.invoke(ActorCell.scala:487)
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
    at akka.dispatch.Mailbox.run(Mailbox.scala:220)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
    [train@sandbox spark-1.2.0.2.2.0.0-82-bin-2.6.0.2.2.0.0-2041]$ 
    

【问题讨论】:

Wondeful stracktrace...我们不都喜欢这样的 stacktraces 吗?框架层太多... :-( 【参考方案1】:

可能执行器崩溃了。 Spark 网站上的这个页面,http://spark.apache.org/docs/latest/running-on-yarn.html 讨论了如何查看各种日志以希望找到问题。您也可以试验讨论的调用标志和属性。

例如,如果省略 --driver-memory 512m --executor-memory 512m --executor-cores 1 标志会发生什么?

最后,输入的路径是否存在于 HDFS 中,您是否具有读取权限?您是否拥有/ 的写入权限,因此您可以创建/out1? (但是这些不应该导致这个错误......)

【讨论】:

谢谢@Dean。HDFS 的权限很好。当我不带参数运行时,这是我得到的错误:`15/02/28 22:34:03 WARN cluster.YarnClientClusterScheduler: Initial job has不接受任何资源;检查您的集群 UI 以确保工作人员已注册并有足够的内存 您可以浏览 Cloudera 论坛,因为它们支持 Spark。我与 YARN 合作的时间不够多,无法提供更多建议。

以上是关于Hortonworks 中有关纱线的字数示例失败的主要内容,如果未能解决你的问题,请参考以下文章

JHipster - 纱线构建失败

esbuild 上的纱线构建失败

jHipster:业力测试通过“纱线测试”通过,但在 WebStorm 中失败

在 ReactJS 中构建纱线,分配失败 - JavaScript 堆内存不足

2 NameNode 失败后移动 NameNode - Hortonworks - Hadoop

spark 提交 pyspark 脚本上的纱线投掷超过最大递归深度