gpt4 book ai didi

java - Hortonworks中关于yarn的Wordcount示例失败

转载 作者:行者123 更新时间:2023-12-02 21:40:56 27 4
gpt4 key购买 nike

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

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

这是我执行的步骤:

  • 在Eclipse IDE中,我创建了一个Java项目,并在src导演下创建了一个JavaWordCount文件,该代码取自Apache Spark附带的示例示例。
  • 然后,我使用Eclipse-> export->作为jar创建了jar,并将该jar文件保存在本地系统中。
  • 然后在终端上,我进入了主目录并发出了以下命令:
    [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]$
  • 最佳答案

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

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

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

    关于java - Hortonworks中关于yarn的Wordcount示例失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28783791/

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