spark-submit 不使用 YARN
spark-submit not using YARN
我已经用 YARN 设置了一个 5 节点的 hadoop 集群,Spark 也在所有 5 个节点上设置。我正在使用 spark-1.5.0-cdh5.5.0
当我运行
spark-shell --master yarn --num-executors 3
这将按预期启动 shell 并使用 yarn 从 RM 获取资源。所以,我猜 spark 正在按预期使用 hadoop conf 文件。但是当我做 spark-submit
spark-submit word_count.py --master yarn-cluster --num-executors 3
这是在尝试连接到 spark master,据信在 运行ning on yarn 上不需要连接。错误如下:
16/11/08 00:18:31 INFO util.Utils: Successfully started service 'HTTP file server' on port 47990.
16/11/08 00:18:31 INFO spark.SparkEnv: Registering OutputCommitCoordinator
16/11/08 00:18:41 INFO server.Server: jetty-8.y.z-SNAPSHOT
16/11/08 00:18:41 INFO server.AbstractConnector: Started SelectChannelConnector@0.0.0.0:4040
16/11/08 00:18:41 INFO util.Utils: Successfully started service 'SparkUI' on port 4040.
16/11/08 00:18:41 INFO ui.SparkUI: Started SparkUI at http://10.0.0.4:4040
16/11/08 00:18:41 INFO util.Utils: Copying /home/rshaik26/word_count.py to /tmp/spark-0a5348f8-5ba8-4906-89af-7499054b554e/userFiles-287b5d13-123a-4bd6-9fe3-489af2a502a1/word_count.py
16/11/08 00:18:41 INFO spark.SparkContext: Added file file:/home/rshaik26/word_count.py at http://10.0.0.4:47990/files/word_count.py with timestamp 1478544521986
16/11/08 00:18:42 WARN metrics.MetricsSystem: Using default name DAGScheduler for source because spark.app.id is not set.
16/11/08 00:18:42 INFO client.AppClient$ClientEndpoint: Connecting to master spark://ubuntuhdp2:7077...
16/11/08 00:18:42 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:18:42 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:18:42 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:18:42 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:18:42 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:18:42 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:18:42 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:18:42 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:18:42 WARN client.AppClient$ClientEndpoint: Failed to connect to master ubuntuhdp2:7077
akka.actor.ActorNotFound: Actor not found for: ActorSelection[Actor[akka.tcp://sparkMaster@ubuntuhdp2:7077/]/user/Master]
at akka.actor.ActorSelection$$anonfun$resolveOne.apply(ActorSelection.scala:66)
at akka.actor.ActorSelection$$anonfun$resolveOne.apply(ActorSelection.scala:64)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.processBatch(BatchingExecutor.scala:67)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply$mcV$sp(BatchingExecutor.scala:82)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply(BatchingExecutor.scala:59)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply(BatchingExecutor.scala:59)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58)
at akka.dispatch.ExecutionContexts$sameThreadExecutionContext$.unbatchedExecute(Future.scala:74)
at akka.dispatch.BatchingExecutor$class.execute(BatchingExecutor.scala:110)
at akka.dispatch.ExecutionContexts$sameThreadExecutionContext$.execute(Future.scala:73)
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248)
at akka.pattern.PromiseActorRef.$bang(AskSupport.scala:269)
at akka.actor.EmptyLocalActorRef.specialHandle(ActorRef.scala:512)
at akka.actor.DeadLetterActorRef.specialHandle(ActorRef.scala:545)
at akka.actor.DeadLetterActorRef.$bang(ActorRef.scala:535)
at akka.remote.RemoteActorRefProvider$RemoteDeadLetterActorRef.$bang(RemoteActorRefProvider.scala:91)
at akka.actor.ActorRef.tell(ActorRef.scala:125)
at akka.dispatch.Mailboxes$$anon$$anon.enqueue(Mailboxes.scala:44)
at akka.dispatch.QueueBasedMessageQueue$class.cleanUp(Mailbox.scala:438)
at akka.dispatch.UnboundedDequeBasedMailbox$MessageQueue.cleanUp(Mailbox.scala:650)
at akka.dispatch.Mailbox.cleanUp(Mailbox.scala:309)
at akka.dispatch.MessageDispatcher.unregister(AbstractDispatcher.scala:204)
at akka.dispatch.MessageDispatcher.detach(AbstractDispatcher.scala:140)
at akka.actor.dungeon.FaultHandling$class.akka$actor$dungeon$FaultHandling$$finishTerminate(FaultHandling.scala:203)
at akka.actor.dungeon.FaultHandling$class.terminate(FaultHandling.scala:163)
at akka.actor.ActorCell.terminate(ActorCell.scala:338)
at akka.actor.ActorCell.invokeAll(ActorCell.scala:431)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:447)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:262)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:240)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
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)
16/11/08 00:19:02 INFO client.AppClient$ClientEndpoint: Connecting to master spark://ubuntuhdp2:7077...
16/11/08 00:19:02 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:19:02 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:19:02 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:19:02 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:19:02 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:19:02 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:19:02 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:19:02 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:19:02 WARN client.AppClient$ClientEndpoint: Failed to connect to master ubuntuhdp2:7077
akka.actor.ActorNotFound: Actor not found for: ActorSelection[Actor[akka.tcp://sparkMaster@ubuntuhdp2:7077/]/user/Master]
at akka.actor.ActorSelection$$anonfun$resolveOne.apply(ActorSelection.scala:66)
at akka.actor.ActorSelection$$anonfun$resolveOne.apply(ActorSelection.scala:64)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.processBatch(BatchingExecutor.scala:67)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply$mcV$sp(BatchingExecutor.scala:82)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply(BatchingExecutor.scala:59)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply(BatchingExecutor.scala:59)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58)
at akka.dispatch.ExecutionContexts$sameThreadExecutionContext$.unbatchedExecute(Future.scala:74)
at akka.dispatch.BatchingExecutor$class.execute(BatchingExecutor.scala:110)
at akka.dispatch.ExecutionContexts$sameThreadExecutionContext$.execute(Future.scala:73)
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248)
at akka.pattern.PromiseActorRef.$bang(AskSupport.scala:269)
at akka.actor.EmptyLocalActorRef.specialHandle(ActorRef.scala:512)
at akka.actor.DeadLetterActorRef.specialHandle(ActorRef.scala:545)
at akka.actor.DeadLetterActorRef.$bang(ActorRef.scala:535)
at akka.remote.RemoteActorRefProvider$RemoteDeadLetterActorRef.$bang(RemoteActorRefProvider.scala:91)
at akka.actor.ActorRef.tell(ActorRef.scala:125)
at akka.dispatch.Mailboxes$$anon$$anon.enqueue(Mailboxes.scala:44)
at akka.dispatch.QueueBasedMessageQueue$class.cleanUp(Mailbox.scala:438)
at akka.dispatch.UnboundedDequeBasedMailbox$MessageQueue.cleanUp(Mailbox.scala:650)
at akka.dispatch.Mailbox.cleanUp(Mailbox.scala:309)
at akka.dispatch.MessageDispatcher.unregister(AbstractDispatcher.scala:204)
at akka.dispatch.MessageDispatcher.detach(AbstractDispatcher.scala:140)
at akka.actor.dungeon.FaultHandling$class.akka$actor$dungeon$FaultHandling$$finishTerminate(FaultHandling.scala:203)
at akka.actor.dungeon.FaultHandling$class.terminate(FaultHandling.scala:163)
at akka.actor.ActorCell.terminate(ActorCell.scala:338)
at akka.actor.ActorCell.invokeAll(ActorCell.scala:431)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:447)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:262)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:240)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
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)
如果有任何配置错误请帮助我
这里是火花-env.sh
SPARK_JAVA_OPTS=-Dspark.driver.port=53411
HADOOP_CONF_DIR=/usr/lib/hadoop-2.6.0-cdh5.5.0/etc/hadoop/
SPARK_MASTER_IP=ubuntuhdp2
SPARK_DIST_CLASSPATH=$(hadoop classpath):/usr/lib/hadoop-2.6.0-cdh5.5.0/share/hadoop/tools/lib/*
火花-defaults.conf
spark.master spark://ubuntuhdp2:7077
# spark.eventLog.enabled true
# spark.eventLog.dir hdfs://namenode:8021/directory
spark.serializer org.apache.spark.serializer.KryoSerializer
# spark.driver.memory 5g
# spark.executor.extraJavaOptions -XX:+PrintGCDetails -Dkey=value -Dnumbers="one two three"
我相信:
spark-submit word_count.py --master yarn-cluster --num-executors 3
你跟spark launching
说"I want to submit word_count.py
and my [application-arguments]
are --master yarn-cluster --num-executors 3
"所以他选择了默认master
尝试以下操作:
spark-submit --master yarn-cluster --num-executors 3 word_count.py
是的,这应该将 spark 提交给 yarn,当您定义 -cluster
时,您的应用程序会在集群上的某处运行(在 "yarn resource node" 上)。
我在我的系统上试过了。线索是这个日志语句:
numExecutors have been set to default : 2
maxExecutors have been set to default : 2
即使我增加了执行者的数量,我也得到了同样的结果。
所以修复很简单:
spark-submit --master yarn-cluster --num-executors 3 word_count.py
我已经用 YARN 设置了一个 5 节点的 hadoop 集群,Spark 也在所有 5 个节点上设置。我正在使用 spark-1.5.0-cdh5.5.0
当我运行
spark-shell --master yarn --num-executors 3
这将按预期启动 shell 并使用 yarn 从 RM 获取资源。所以,我猜 spark 正在按预期使用 hadoop conf 文件。但是当我做 spark-submit
spark-submit word_count.py --master yarn-cluster --num-executors 3
这是在尝试连接到 spark master,据信在 运行ning on yarn 上不需要连接。错误如下:
16/11/08 00:18:31 INFO util.Utils: Successfully started service 'HTTP file server' on port 47990.
16/11/08 00:18:31 INFO spark.SparkEnv: Registering OutputCommitCoordinator
16/11/08 00:18:41 INFO server.Server: jetty-8.y.z-SNAPSHOT
16/11/08 00:18:41 INFO server.AbstractConnector: Started SelectChannelConnector@0.0.0.0:4040
16/11/08 00:18:41 INFO util.Utils: Successfully started service 'SparkUI' on port 4040.
16/11/08 00:18:41 INFO ui.SparkUI: Started SparkUI at http://10.0.0.4:4040
16/11/08 00:18:41 INFO util.Utils: Copying /home/rshaik26/word_count.py to /tmp/spark-0a5348f8-5ba8-4906-89af-7499054b554e/userFiles-287b5d13-123a-4bd6-9fe3-489af2a502a1/word_count.py
16/11/08 00:18:41 INFO spark.SparkContext: Added file file:/home/rshaik26/word_count.py at http://10.0.0.4:47990/files/word_count.py with timestamp 1478544521986
16/11/08 00:18:42 WARN metrics.MetricsSystem: Using default name DAGScheduler for source because spark.app.id is not set.
16/11/08 00:18:42 INFO client.AppClient$ClientEndpoint: Connecting to master spark://ubuntuhdp2:7077...
16/11/08 00:18:42 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:18:42 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:18:42 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:18:42 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:18:42 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:18:42 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:18:42 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:18:42 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:18:42 WARN client.AppClient$ClientEndpoint: Failed to connect to master ubuntuhdp2:7077
akka.actor.ActorNotFound: Actor not found for: ActorSelection[Actor[akka.tcp://sparkMaster@ubuntuhdp2:7077/]/user/Master]
at akka.actor.ActorSelection$$anonfun$resolveOne.apply(ActorSelection.scala:66)
at akka.actor.ActorSelection$$anonfun$resolveOne.apply(ActorSelection.scala:64)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.processBatch(BatchingExecutor.scala:67)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply$mcV$sp(BatchingExecutor.scala:82)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply(BatchingExecutor.scala:59)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply(BatchingExecutor.scala:59)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58)
at akka.dispatch.ExecutionContexts$sameThreadExecutionContext$.unbatchedExecute(Future.scala:74)
at akka.dispatch.BatchingExecutor$class.execute(BatchingExecutor.scala:110)
at akka.dispatch.ExecutionContexts$sameThreadExecutionContext$.execute(Future.scala:73)
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248)
at akka.pattern.PromiseActorRef.$bang(AskSupport.scala:269)
at akka.actor.EmptyLocalActorRef.specialHandle(ActorRef.scala:512)
at akka.actor.DeadLetterActorRef.specialHandle(ActorRef.scala:545)
at akka.actor.DeadLetterActorRef.$bang(ActorRef.scala:535)
at akka.remote.RemoteActorRefProvider$RemoteDeadLetterActorRef.$bang(RemoteActorRefProvider.scala:91)
at akka.actor.ActorRef.tell(ActorRef.scala:125)
at akka.dispatch.Mailboxes$$anon$$anon.enqueue(Mailboxes.scala:44)
at akka.dispatch.QueueBasedMessageQueue$class.cleanUp(Mailbox.scala:438)
at akka.dispatch.UnboundedDequeBasedMailbox$MessageQueue.cleanUp(Mailbox.scala:650)
at akka.dispatch.Mailbox.cleanUp(Mailbox.scala:309)
at akka.dispatch.MessageDispatcher.unregister(AbstractDispatcher.scala:204)
at akka.dispatch.MessageDispatcher.detach(AbstractDispatcher.scala:140)
at akka.actor.dungeon.FaultHandling$class.akka$actor$dungeon$FaultHandling$$finishTerminate(FaultHandling.scala:203)
at akka.actor.dungeon.FaultHandling$class.terminate(FaultHandling.scala:163)
at akka.actor.ActorCell.terminate(ActorCell.scala:338)
at akka.actor.ActorCell.invokeAll(ActorCell.scala:431)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:447)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:262)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:240)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
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)
16/11/08 00:19:02 INFO client.AppClient$ClientEndpoint: Connecting to master spark://ubuntuhdp2:7077...
16/11/08 00:19:02 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:19:02 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:19:02 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:19:02 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:19:02 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:19:02 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:19:02 WARN client.AppClient$ClientEndpoint: Could not connect to ubuntuhdp2:7077: akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
16/11/08 00:19:02 ERROR akka.ErrorMonitor: AssociationError [akka.tcp://sparkDriver@10.0.0.4:53411] -> [akka.tcp://sparkMaster@ubuntuhdp2:7077]: Error [Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]] [
akka.remote.EndpointAssociationException: Association failed with [akka.tcp://sparkMaster@ubuntuhdp2:7077]
Caused by: akka.remote.transport.netty.NettyTransport$$anonfun$associate$$anon: Connection refused: ubuntuhdp2/10.0.0.4:7077
]
akka.event.Logging$Error$NoCause$
16/11/08 00:19:02 WARN client.AppClient$ClientEndpoint: Failed to connect to master ubuntuhdp2:7077
akka.actor.ActorNotFound: Actor not found for: ActorSelection[Actor[akka.tcp://sparkMaster@ubuntuhdp2:7077/]/user/Master]
at akka.actor.ActorSelection$$anonfun$resolveOne.apply(ActorSelection.scala:66)
at akka.actor.ActorSelection$$anonfun$resolveOne.apply(ActorSelection.scala:64)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.processBatch(BatchingExecutor.scala:67)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply$mcV$sp(BatchingExecutor.scala:82)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply(BatchingExecutor.scala:59)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run.apply(BatchingExecutor.scala:59)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58)
at akka.dispatch.ExecutionContexts$sameThreadExecutionContext$.unbatchedExecute(Future.scala:74)
at akka.dispatch.BatchingExecutor$class.execute(BatchingExecutor.scala:110)
at akka.dispatch.ExecutionContexts$sameThreadExecutionContext$.execute(Future.scala:73)
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248)
at akka.pattern.PromiseActorRef.$bang(AskSupport.scala:269)
at akka.actor.EmptyLocalActorRef.specialHandle(ActorRef.scala:512)
at akka.actor.DeadLetterActorRef.specialHandle(ActorRef.scala:545)
at akka.actor.DeadLetterActorRef.$bang(ActorRef.scala:535)
at akka.remote.RemoteActorRefProvider$RemoteDeadLetterActorRef.$bang(RemoteActorRefProvider.scala:91)
at akka.actor.ActorRef.tell(ActorRef.scala:125)
at akka.dispatch.Mailboxes$$anon$$anon.enqueue(Mailboxes.scala:44)
at akka.dispatch.QueueBasedMessageQueue$class.cleanUp(Mailbox.scala:438)
at akka.dispatch.UnboundedDequeBasedMailbox$MessageQueue.cleanUp(Mailbox.scala:650)
at akka.dispatch.Mailbox.cleanUp(Mailbox.scala:309)
at akka.dispatch.MessageDispatcher.unregister(AbstractDispatcher.scala:204)
at akka.dispatch.MessageDispatcher.detach(AbstractDispatcher.scala:140)
at akka.actor.dungeon.FaultHandling$class.akka$actor$dungeon$FaultHandling$$finishTerminate(FaultHandling.scala:203)
at akka.actor.dungeon.FaultHandling$class.terminate(FaultHandling.scala:163)
at akka.actor.ActorCell.terminate(ActorCell.scala:338)
at akka.actor.ActorCell.invokeAll(ActorCell.scala:431)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:447)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:262)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:240)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
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)
如果有任何配置错误请帮助我
这里是火花-env.sh
SPARK_JAVA_OPTS=-Dspark.driver.port=53411
HADOOP_CONF_DIR=/usr/lib/hadoop-2.6.0-cdh5.5.0/etc/hadoop/
SPARK_MASTER_IP=ubuntuhdp2
SPARK_DIST_CLASSPATH=$(hadoop classpath):/usr/lib/hadoop-2.6.0-cdh5.5.0/share/hadoop/tools/lib/*
火花-defaults.conf
spark.master spark://ubuntuhdp2:7077
# spark.eventLog.enabled true
# spark.eventLog.dir hdfs://namenode:8021/directory
spark.serializer org.apache.spark.serializer.KryoSerializer
# spark.driver.memory 5g
# spark.executor.extraJavaOptions -XX:+PrintGCDetails -Dkey=value -Dnumbers="one two three"
我相信:
spark-submit word_count.py --master yarn-cluster --num-executors 3
你跟spark launching
说"I want to submit word_count.py
and my [application-arguments]
are --master yarn-cluster --num-executors 3
"所以他选择了默认master
尝试以下操作:
spark-submit --master yarn-cluster --num-executors 3 word_count.py
是的,这应该将 spark 提交给 yarn,当您定义 -cluster
时,您的应用程序会在集群上的某处运行(在 "yarn resource node" 上)。
我在我的系统上试过了。线索是这个日志语句:
numExecutors have been set to default : 2
maxExecutors have been set to default : 2
即使我增加了执行者的数量,我也得到了同样的结果。
所以修复很简单:
spark-submit --master yarn-cluster --num-executors 3 word_count.py