shell - 尝试在工作程序上启动执行程序时,Apache Spark shell 崩溃

标签 shell scala apache-spark

背景

我一直在与 Apache Spark 作斗争,并且解决了除一个之外的大多数错误。我有一个主人和一个奴隶。我可以通过
./sbin/start-master.sh
然后我可以从奴隶连接到它
JAVA_OPTS="-Xmx10g" ./bin/spark-class org.apache.spark.deploy.worker.Worker spark://10.17.16.43:7077
然后我看到成功消息
14/08/25 08:47:04 INFO worker.Worker: Successfully registered with master spark://10.17.16.43:7077
所有这些错误都是可重复的(我已经有一段时间了)。正如大多数其他教程中提到的那样,我可以很好地从从服务器 telnet 到主服务器。 SSH 配置为不需要在其他地方提到的主从(RSA key )之间的密码。

我将 spark/conf/spark-env.sh 设置为以下内容。注释掉的行比较多

export SPARK_DAEMON_JAVA_OPTS+=" -Dspark.local.dir=/mnt/spark,/mnt2/spark -Dspark.akka.logLifecycleEvents=true"
export SPARK_LOCAL_IP=`ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p' | head -1`
export SPARK_MASTER_IP=$SPARK_LOCAL_IP
export SPARK_MASTER_WEBUI_PORT=8090
export SPARK_WORKER_CORES=1

我从各种教程中提取了它们,希望它们能解决一些问题。

这是我的主人 /etc/hosts
127.0.0.1       localhost
10.17.16.43     aidan-workstation
10.17.16.49     ubuntu

和奴隶
127.0.0.1   localhost
10.17.16.49 ubuntu
10.17.16.43 aidan-workstation

错误

当我运行 ./bin/spark-shell
我在主终端中得到以下内容(刚刚发布了它的尾端,完整的输出是 here )
14/08/25 08:58:25 INFO client.AppClient$ClientActor: Executor added: app-20140825085822-0002/8 on worker-20140825084704-ubuntu-49237 (ubuntu:49237) with 8 cores
14/08/25 08:58:25 INFO cluster.SparkDeploySchedulerBackend: Granted executor ID app-20140825085822-0002/8 on hostPort ubuntu:49237 with 8 cores, 512.0 MB RAM
14/08/25 08:58:25 INFO client.AppClient$ClientActor: Executor updated: app-20140825085822-0002/8 is now RUNNING
14/08/25 08:58:25 INFO client.AppClient$ClientActor: Executor updated: app-20140825085822-0002/8 is now FAILED (Command exited with code 1)
14/08/25 08:58:25 INFO cluster.SparkDeploySchedulerBackend: Executor app-20140825085822-0002/8 removed: Command exited with code 1
14/08/25 08:58:25 INFO client.AppClient$ClientActor: Executor added: app-20140825085822-0002/9 on worker-20140825084704-ubuntu-49237 (ubuntu:49237) with 8 cores
14/08/25 08:58:25 INFO cluster.SparkDeploySchedulerBackend: Granted executor ID app-20140825085822-0002/9 on hostPort ubuntu:49237 with 8 cores, 512.0 MB RAM
14/08/25 08:58:25 INFO client.AppClient$ClientActor: Executor updated: app-20140825085822-0002/9 is now RUNNING
14/08/25 08:58:25 INFO client.AppClient$ClientActor: Executor updated: app-20140825085822-0002/9 is now FAILED (Command exited with code 1)
14/08/25 08:58:25 INFO cluster.SparkDeploySchedulerBackend: Executor app-20140825085822-0002/9 removed: Command exited with code 1
14/08/25 08:58:25 ERROR client.AppClient$ClientActor: Master removed our application: FAILED; stopping client
14/08/25 08:58:25 WARN cluster.SparkDeploySchedulerBackend: Disconnected from Spark cluster! Waiting for reconnection...

同时从站输出(tail 和 full 输出也是 here)
14/08/25 09:04:18 INFO worker.ExecutorRunner: Launch command: "/usr/lib/jvm/java-8-oracle/bin/java" "-cp" ":/home/hduser/spark/conf:/home/hduser/spark/assembly/target/scala-2.10/spark-assembly_2.10-0.9.2-hadoop2.2.0.jar:/home/hduser/hadoop/etc/hadoop" "-Xms512M" "-Xmx512M" "org.apache.spark.executor.CoarseGrainedExecutorBackend" "akka.tcp://spark@aidan-workstation:60456/user/CoarseGrainedScheduler" "7" "ubuntu" "8" "akka.tcp://sparkWorker@ubuntu:55553/user/Worker" "app-20140825090434-0003"
14/08/25 09:04:18 INFO worker.Worker: Executor app-20140825090434-0003/7 finished with state FAILED message Command exited with code 1 exitStatus 1
14/08/25 09:04:18 INFO worker.Worker: Asked to launch executor app-20140825090434-0003/8 for Spark shell
14/08/25 09:04:18 INFO worker.ExecutorRunner: Launch command: "/usr/lib/jvm/java-8-oracle/bin/java" "-cp" ":/home/hduser/spark/conf:/home/hduser/spark/assembly/target/scala-2.10/spark-assembly_2.10-0.9.2-hadoop2.2.0.jar:/home/hduser/hadoop/etc/hadoop" "-Xms512M" "-Xmx512M" "org.apache.spark.executor.CoarseGrainedExecutorBackend" "akka.tcp://spark@aidan-workstation:60456/user/CoarseGrainedScheduler" "8" "ubuntu" "8" "akka.tcp://sparkWorker@ubuntu:55553/user/Worker" "app-20140825090434-0003"
14/08/25 09:04:19 INFO worker.Worker: Executor app-20140825090434-0003/8 finished with state FAILED message Command exited with code 1 exitStatus 1
14/08/25 09:04:19 INFO worker.Worker: Asked to launch executor app-20140825090434-0003/9 for Spark shell
14/08/25 09:04:19 INFO worker.ExecutorRunner: Launch command: "/usr/lib/jvm/java-8-oracle/bin/java" "-cp" ":/home/hduser/spark/conf:/home/hduser/spark/assembly/target/scala-2.10/spark-assembly_2.10-0.9.2-hadoop2.2.0.jar:/home/hduser/hadoop/etc/hadoop" "-Xms512M" "-Xmx512M" "org.apache.spark.executor.CoarseGrainedExecutorBackend" "akka.tcp://spark@aidan-workstation:60456/user/CoarseGrainedScheduler" "9" "ubuntu" "8" "akka.tcp://sparkWorker@ubuntu:55553/user/Worker" "app-20140825090434-0003"
14/08/25 09:04:19 INFO worker.Worker: Executor app-20140825090434-0003/9 finished with state FAILED message Command exited with code 1 exitStatus 1

您可能会注意到时间已经关闭。这是我的错。我不得不在不同的时间重新运行程序以获得干净的输出。这不是程序的原因。

我想要什么

如何连接我的主站和从站,以便我可以在分布式系统上运行 Scala 程序?

最佳答案

我从您的日志中注意到 akka 使用的是简单的主机名 aidan-workstation 而不是像 aidan-workstation.acme.com 这样的完全限定域名

akka.tcp://spark@aidan-workstation:60456/user/CoarseGrainedScheduler
akka.tcp://sparkWorker@ubuntu:55553/user/Worker

From this user post 它“可能”是您遇到的问题

I had to set SPARK_MASTER_IP in conf/start-master.sh to hostname -f instead of hostname, since akka seems not to work properly with host names / ip, it requires fully qualified domain names.



您可以尝试编辑您的主机文件以包含伪造的域名。

关于shell - 尝试在工作程序上启动执行程序时,Apache Spark shell 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25490021/

相关文章:

linux - 程序从终端运行良好,但不能从 shell 脚本运行

linux - 在 Linux 中,如何编写脚本来抓取所有 .js 文件?

linux - 两个序列中缺少数字

scala - 是否有键盘快捷键来回跳到SublimeSBT控制台和sublime中的编辑器?

scala - Scala 中函数组合的好语法

apache-spark - 如何在 EC2 Spark 集群上训练深度神经网络(tensorflow)?

linux - 对文件进行排序,然后按原始顺序打印出其中的一部分 - Bash

scala - `this` 输入 Scala

hadoop - 在 spark yarn 集群中,容器如何工作取决于 RDD 分区的数量?

apache-spark - 相当于 Scala Dataset#transform 方法的 Pyspark 变换方法