pyspark shell 未以伪分布式模式启动

Posted

技术标签:

【中文标题】pyspark shell 未以伪分布式模式启动【英文标题】:pyspark shell not launching in pseudo distributed mode 【发布时间】:2017-02-20 07:46:12 【问题描述】:

Pyspark Shell 未在伪分布式模式下启动。但是,独立版本正在推出。

我可以在输入以下命令时运行 spark

$pyspark

$ pyspark --master local[2]

但不是在我运行这个时 -

$ pyspark --master yarn-client

我在伪分布式模式下安装了hadoop,已经启动了dfs.sh 和yarn.sh。它们似乎运行正常

这是失败的 Pyspark 应用程序的日志 -

$ yarn logs -applicationId application_1487575592818_000117/02/19 23:28:13 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
17/02/19 23:28:13 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable


Container: container_1487575592818_0001_01_000003 on aamir-UX303LAB_45668
===========================================================================
LogType:stderr
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:0
Log Contents:
End of LogType:stderr

LogType:stdout
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:0
Log Contents:
End of LogType:stdout



Container: container_1487575592818_0001_01_000002 on aamir-UX303LAB_45668
===========================================================================
LogType:stderr
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:972
Log Contents:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/tmp/hadoop-hadoop/nm-local-dir/usercache/hadoop/filecache/11/__spark_libs__5646685820587492749.zip/slf4j-log4j12-1.7.16.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
17/02/19 23:27:04 INFO executor.CoarseGrainedExecutorBackend: Started daemon with process name: 7048@aamir-UX303LAB
17/02/19 23:27:04 INFO util.SignalUtils: Registered signal handler for TERM
17/02/19 23:27:04 INFO util.SignalUtils: Registered signal handler for HUP
17/02/19 23:27:04 INFO util.SignalUtils: Registered signal handler for INT
17/02/19 23:27:04 ERROR executor.CoarseGrainedExecutorBackend: RECEIVED SIGNAL TERM
End of LogType:stderr

LogType:stdout
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:0
Log Contents:
End of LogType:stdout



Container: container_1487575592818_0001_02_000003 on aamir-UX303LAB_45668
===========================================================================
LogType:stderr
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:0
Log Contents:
End of LogType:stderr

LogType:stdout
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:0
Log Contents:
End of LogType:stdout



Container: container_1487575592818_0001_01_000001 on aamir-UX303LAB_45668
===========================================================================
LogType:stderr
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:9718
Log Contents:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/tmp/hadoop-hadoop/nm-local-dir/usercache/hadoop/filecache/11/__spark_libs__5646685820587492749.zip/slf4j-log4j12-1.7.16.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
17/02/19 23:26:57 INFO util.SignalUtils: Registered signal handler for TERM
17/02/19 23:26:57 INFO util.SignalUtils: Registered signal handler for HUP
17/02/19 23:26:57 INFO util.SignalUtils: Registered signal handler for INT
17/02/19 23:26:58 INFO yarn.ApplicationMaster: Preparing Local resources
17/02/19 23:26:59 INFO yarn.ApplicationMaster: Prepared Local resources Map(pyspark.zip -> resource  scheme: "hdfs" host: "localhost" port: 9000 file: "/user/hadoop/.sparkStaging/application_1487575592818_0001/pyspark.zip"  size: 438753 timestamp: 1487575611551 type: FILE visibility: PRIVATE, __spark_libs__ -> resource  scheme: "hdfs" host: "localhost" port: 9000 file: "/user/hadoop/.sparkStaging/application_1487575592818_0001/__spark_libs__5646685820587492749.zip"  size: 192507295 timestamp: 1487575611386 type: ARCHIVE visibility: PRIVATE, __spark_conf__ -> resource  scheme: "hdfs" host: "localhost" port: 9000 file: "/user/hadoop/.sparkStaging/application_1487575592818_0001/__spark_conf__.zip"  size: 84006 timestamp: 1487575611659 type: ARCHIVE visibility: PRIVATE, py4j-0.10.3-src.zip -> resource  scheme: "hdfs" host: "localhost" port: 9000 file: "/user/hadoop/.sparkStaging/application_1487575592818_0001/py4j-0.10.3-src.zip"  size: 91275 timestamp: 1487575611588 type: FILE visibility: PRIVATE)
17/02/19 23:26:59 INFO yarn.ApplicationMaster: ApplicationAttemptId: appattempt_1487575592818_0001_000001
17/02/19 23:26:59 INFO spark.SecurityManager: Changing view acls to: hadoop
17/02/19 23:26:59 INFO spark.SecurityManager: Changing modify acls to: hadoop
17/02/19 23:26:59 INFO spark.SecurityManager: Changing view acls groups to: 
17/02/19 23:26:59 INFO spark.SecurityManager: Changing modify acls groups to: 
17/02/19 23:26:59 INFO spark.SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(hadoop); groups with view permissions: Set(); users with modify permissions: Set(hadoop); groups with modify permissions: Set()
17/02/19 23:26:59 WARN util.Utils: Your hostname, aamir-UX303LAB resolves to a loopback address: 127.0.1.1; using 10.0.0.240 instead (on interface wlan0)
17/02/19 23:26:59 WARN util.Utils: Set SPARK_LOCAL_IP if you need to bind to another address
17/02/19 23:27:00 INFO yarn.ApplicationMaster: Waiting for Spark driver to be reachable.
17/02/19 23:27:00 INFO yarn.ApplicationMaster: Driver now available: 10.0.0.240:45598
17/02/19 23:27:00 INFO client.TransportClientFactory: Successfully created connection to /10.0.0.240:45598 after 117 ms (0 ms spent in bootstraps)
17/02/19 23:27:00 INFO yarn.ApplicationMaster$AMEndpoint: Add WebUI Filter. AddWebUIFilter(org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter,Map(PROXY_HOSTS -> aamir-UX303LAB, PROXY_URI_BASES -> http://aamir-UX303LAB:8088/proxy/application_1487575592818_0001),/proxy/application_1487575592818_0001)
17/02/19 23:27:00 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8030
17/02/19 23:27:00 INFO yarn.YarnRMClient: Registering the ApplicationMaster
17/02/19 23:27:00 INFO yarn.YarnAllocator: Will request 2 executor containers, each with 1 cores and 1408 MB memory including 384 MB overhead
17/02/19 23:27:00 INFO yarn.YarnAllocator: Canceled 0 container requests (locality no longer needed)
17/02/19 23:27:00 INFO yarn.YarnAllocator: Submitted container request (host: Any, capability: <memory:1408, vCores:1>)
17/02/19 23:27:00 INFO yarn.YarnAllocator: Submitted container request (host: Any, capability: <memory:1408, vCores:1>)
17/02/19 23:27:00 INFO yarn.ApplicationMaster: Started progress reporter thread with (heartbeat : 3000, initial allocation : 200) intervals
17/02/19 23:27:01 INFO impl.AMRMClientImpl: Received new token for : aamir-UX303LAB:45668
17/02/19 23:27:01 INFO yarn.YarnAllocator: Launching container container_1487575592818_0001_01_000002 for on host aamir-UX303LAB
17/02/19 23:27:01 INFO yarn.YarnAllocator: Launching ExecutorRunnable. driverUrl: spark://CoarseGrainedScheduler@10.0.0.240:45598, executorHostname: aamir-UX303LAB
17/02/19 23:27:01 INFO yarn.YarnAllocator: Received 1 containers from YARN, launching executors on 1 of them.
17/02/19 23:27:01 INFO yarn.ExecutorRunnable: Starting Executor Container
17/02/19 23:27:01 INFO impl.ContainerManagementProtocolProxy: yarn.client.max-cached-nodemanagers-proxies : 0
17/02/19 23:27:01 INFO yarn.ExecutorRunnable: Setting up ContainerLaunchContext
17/02/19 23:27:01 INFO yarn.ExecutorRunnable: 
===============================================================================
YARN executor launch context:
env:
CLASSPATH -> PWD<CPS>PWD/__spark_conf__<CPS>PWD/__spark_libs__/*<CPS>$HADOOP_CONF_DIR<CPS>$HADOOP_COMMON_HOME/share/hadoop/common/*<CPS>$HADOOP_COMMON_HOME/share/hadoop/common/lib/*<CPS>$HADOOP_HDFS_HOME/share/hadoop/hdfs/*<CPS>$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*<CPS>$HADOOP_YARN_HOME/share/hadoop/yarn/*<CPS>$HADOOP_YARN_HOME/share/hadoop/yarn/lib/*<CPS>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*<CPS>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*
SPARK_LOG_URL_STDERR -> http://aamir-UX303LAB:8042/node/containerlogs/container_1487575592818_0001_01_000002/hadoop/stderr?start=-4096
SPARK_YARN_STAGING_DIR -> hdfs://localhost:9000/user/hadoop/.sparkStaging/application_1487575592818_0001
SPARK_USER -> hadoop
SPARK_YARN_MODE -> true
PYTHONPATH -> /usr/local/spark/python/lib/py4j-0.10.3-src.zip:/usr/local/spark/python/:<CPS>PWD/pyspark.zip<CPS>PWD/py4j-0.10.3-src.zip
SPARK_LOG_URL_STDOUT -> http://aamir-UX303LAB:8042/node/containerlogs/container_1487575592818_0001_01_000002/hadoop/stdout?start=-4096

command:
JAVA_HOME/bin/java -server -Xmx1024m -Djava.io.tmpdir=PWD/tmp '-Dspark.driver.port=45598' -Dspark.yarn.app.container.log.dir=<LOG_DIR> -XX:OnOutOfMemoryError='kill %p' org.apache.spark.executor.CoarseGrainedExecutorBackend --driver-url spark://CoarseGrainedScheduler@10.0.0.240:45598 --executor-id 1 --hostname aamir-UX303LAB --cores 1 --app-id application_1487575592818_0001 --user-class-path file:$PWD/__app__.jar 1> <LOG_DIR>/stdout 2> <LOG_DIR>/stderr
===============================================================================

17/02/19 23:27:01 INFO impl.ContainerManagementProtocolProxy: Opening proxy : aamir-UX303LAB:45668
17/02/19 23:27:02 INFO yarn.YarnAllocator: Launching container container_1487575592818_0001_01_000003 for on host aamir-UX303LAB
17/02/19 23:27:02 INFO yarn.YarnAllocator: Launching ExecutorRunnable. driverUrl: spark://CoarseGrainedScheduler@10.0.0.240:45598, executorHostname: aamir-UX303LAB
17/02/19 23:27:02 INFO yarn.YarnAllocator: Received 1 containers from YARN, launching executors on 1 of them.
17/02/19 23:27:02 INFO yarn.ExecutorRunnable: Starting Executor Container
17/02/19 23:27:02 INFO impl.ContainerManagementProtocolProxy: yarn.client.max-cached-nodemanagers-proxies : 0
17/02/19 23:27:02 INFO yarn.ExecutorRunnable: Setting up ContainerLaunchContext
17/02/19 23:27:02 INFO yarn.ExecutorRunnable: 
===============================================================================
YARN executor launch context:
env:
CLASSPATH -> PWD<CPS>PWD/__spark_conf__<CPS>PWD/__spark_libs__/*<CPS>$HADOOP_CONF_DIR<CPS>$HADOOP_COMMON_HOME/share/hadoop/common/*<CPS>$HADOOP_COMMON_HOME/share/hadoop/common/lib/*<CPS>$HADOOP_HDFS_HOME/share/hadoop/hdfs/*<CPS>$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*<CPS>$HADOOP_YARN_HOME/share/hadoop/yarn/*<CPS>$HADOOP_YARN_HOME/share/hadoop/yarn/lib/*<CPS>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*<CPS>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*
SPARK_LOG_URL_STDERR -> http://aamir-UX303LAB:8042/node/containerlogs/container_1487575592818_0001_01_000003/hadoop/stderr?start=-4096
SPARK_YARN_STAGING_DIR -> hdfs://localhost:9000/user/hadoop/.sparkStaging/application_1487575592818_0001
SPARK_USER -> hadoop
SPARK_YARN_MODE -> true
PYTHONPATH -> /usr/local/spark/python/lib/py4j-0.10.3-src.zip:/usr/local/spark/python/:<CPS>PWD/pyspark.zip<CPS>PWD/py4j-0.10.3-src.zip
SPARK_LOG_URL_STDOUT -> http://aamir-UX303LAB:8042/node/containerlogs/container_1487575592818_0001_01_000003/hadoop/stdout?start=-4096

command:
JAVA_HOME/bin/java -server -Xmx1024m -Djava.io.tmpdir=PWD/tmp '-Dspark.driver.port=45598' -Dspark.yarn.app.container.log.dir=<LOG_DIR> -XX:OnOutOfMemoryError='kill %p' org.apache.spark.executor.CoarseGrainedExecutorBackend --driver-url spark://CoarseGrainedScheduler@10.0.0.240:45598 --executor-id 2 --hostname aamir-UX303LAB --cores 1 --app-id application_1487575592818_0001 --user-class-path file:$PWD/__app__.jar 1> <LOG_DIR>/stdout 2> <LOG_DIR>/stderr
===============================================================================

17/02/19 23:27:02 INFO impl.ContainerManagementProtocolProxy: Opening proxy : aamir-UX303LAB:45668
17/02/19 23:27:03 ERROR yarn.ApplicationMaster: RECEIVED SIGNAL TERM
17/02/19 23:27:03 INFO yarn.ApplicationMaster: Final app status: UNDEFINED, exitCode: 16, (reason: Shutdown hook called before final status was reported.)
17/02/19 23:27:03 INFO util.ShutdownHookManager: Shutdown hook called
End of LogType:stderr

LogType:stdout
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:0
Log Contents:
End of LogType:stdout



Container: container_1487575592818_0001_02_000002 on aamir-UX303LAB_45668
===========================================================================
LogType:stderr
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:0
Log Contents:
End of LogType:stderr

LogType:stdout
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:0
Log Contents:
End of LogType:stdout



Container: container_1487575592818_0001_02_000001 on aamir-UX303LAB_45668
===========================================================================
LogType:stderr
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:10631
Log Contents:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/tmp/hadoop-hadoop/nm-local-dir/usercache/hadoop/filecache/11/__spark_libs__5646685820587492749.zip/slf4j-log4j12-1.7.16.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
17/02/19 23:27:05 INFO util.SignalUtils: Registered signal handler for TERM
17/02/19 23:27:05 INFO util.SignalUtils: Registered signal handler for HUP
17/02/19 23:27:05 INFO util.SignalUtils: Registered signal handler for INT
17/02/19 23:27:06 INFO yarn.ApplicationMaster: Preparing Local resources
17/02/19 23:27:07 INFO yarn.ApplicationMaster: Prepared Local resources Map(pyspark.zip -> resource  scheme: "hdfs" host: "localhost" port: 9000 file: "/user/hadoop/.sparkStaging/application_1487575592818_0001/pyspark.zip"  size: 438753 timestamp: 1487575611551 type: FILE visibility: PRIVATE, __spark_libs__ -> resource  scheme: "hdfs" host: "localhost" port: 9000 file: "/user/hadoop/.sparkStaging/application_1487575592818_0001/__spark_libs__5646685820587492749.zip"  size: 192507295 timestamp: 1487575611386 type: ARCHIVE visibility: PRIVATE, __spark_conf__ -> resource  scheme: "hdfs" host: "localhost" port: 9000 file: "/user/hadoop/.sparkStaging/application_1487575592818_0001/__spark_conf__.zip"  size: 84006 timestamp: 1487575611659 type: ARCHIVE visibility: PRIVATE, py4j-0.10.3-src.zip -> resource  scheme: "hdfs" host: "localhost" port: 9000 file: "/user/hadoop/.sparkStaging/application_1487575592818_0001/py4j-0.10.3-src.zip"  size: 91275 timestamp: 1487575611588 type: FILE visibility: PRIVATE)
17/02/19 23:27:07 INFO yarn.ApplicationMaster: ApplicationAttemptId: appattempt_1487575592818_0001_000002
17/02/19 23:27:07 INFO spark.SecurityManager: Changing view acls to: hadoop
17/02/19 23:27:07 INFO spark.SecurityManager: Changing modify acls to: hadoop
17/02/19 23:27:07 INFO spark.SecurityManager: Changing view acls groups to: 
17/02/19 23:27:07 INFO spark.SecurityManager: Changing modify acls groups to: 
17/02/19 23:27:07 INFO spark.SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(hadoop); groups with view permissions: Set(); users with modify permissions: Set(hadoop); groups with modify permissions: Set()
17/02/19 23:27:07 WARN util.Utils: Your hostname, aamir-UX303LAB resolves to a loopback address: 127.0.1.1; using 10.0.0.240 instead (on interface wlan0)
17/02/19 23:27:07 WARN util.Utils: Set SPARK_LOCAL_IP if you need to bind to another address
17/02/19 23:27:07 INFO yarn.ApplicationMaster: Waiting for Spark driver to be reachable.
17/02/19 23:27:07 INFO yarn.ApplicationMaster: Driver now available: 10.0.0.240:45598
17/02/19 23:27:08 INFO client.TransportClientFactory: Successfully created connection to /10.0.0.240:45598 after 104 ms (0 ms spent in bootstraps)
17/02/19 23:27:08 INFO yarn.ApplicationMaster$AMEndpoint: Add WebUI Filter. AddWebUIFilter(org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter,Map(PROXY_HOSTS -> aamir-UX303LAB, PROXY_URI_BASES -> http://aamir-UX303LAB:8088/proxy/application_1487575592818_0001),/proxy/application_1487575592818_0001)
17/02/19 23:27:08 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8030
17/02/19 23:27:08 INFO yarn.YarnRMClient: Registering the ApplicationMaster
17/02/19 23:27:08 INFO yarn.YarnAllocator: Will request 2 executor containers, each with 1 cores and 1408 MB memory including 384 MB overhead
17/02/19 23:27:08 INFO yarn.YarnAllocator: Canceled 0 container requests (locality no longer needed)
17/02/19 23:27:08 INFO yarn.YarnAllocator: Submitted container request (host: Any, capability: <memory:1408, vCores:1>)
17/02/19 23:27:08 INFO yarn.YarnAllocator: Submitted container request (host: Any, capability: <memory:1408, vCores:1>)
17/02/19 23:27:08 INFO impl.AMRMClientImpl: Received new token for : aamir-UX303LAB:45668
17/02/19 23:27:08 INFO yarn.YarnAllocator: Launching container container_1487575592818_0001_02_000002 for on host aamir-UX303LAB
17/02/19 23:27:08 INFO yarn.YarnAllocator: Launching ExecutorRunnable. driverUrl: spark://CoarseGrainedScheduler@10.0.0.240:45598, executorHostname: aamir-UX303LAB
17/02/19 23:27:08 INFO yarn.YarnAllocator: Received 1 containers from YARN, launching executors on 1 of them.
17/02/19 23:27:08 INFO yarn.ExecutorRunnable: Starting Executor Container
17/02/19 23:27:08 INFO yarn.ApplicationMaster: Started progress reporter thread with (heartbeat : 3000, initial allocation : 200) intervals
17/02/19 23:27:08 INFO yarn.YarnAllocator: Will request 1 executor containers, each with 1 cores and 1408 MB memory including 384 MB overhead
17/02/19 23:27:08 INFO yarn.YarnAllocator: Canceled 0 container requests (locality no longer needed)
17/02/19 23:27:08 INFO yarn.YarnAllocator: Submitted container request (host: Any, capability: <memory:1408, vCores:1>)
17/02/19 23:27:08 INFO impl.ContainerManagementProtocolProxy: yarn.client.max-cached-nodemanagers-proxies : 0
17/02/19 23:27:08 INFO yarn.ExecutorRunnable: Setting up ContainerLaunchContext
17/02/19 23:27:08 INFO yarn.ExecutorRunnable: 
===============================================================================
YARN executor launch context:
env:
CLASSPATH -> PWD<CPS>PWD/__spark_conf__<CPS>PWD/__spark_libs__/*<CPS>$HADOOP_CONF_DIR<CPS>$HADOOP_COMMON_HOME/share/hadoop/common/*<CPS>$HADOOP_COMMON_HOME/share/hadoop/common/lib/*<CPS>$HADOOP_HDFS_HOME/share/hadoop/hdfs/*<CPS>$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*<CPS>$HADOOP_YARN_HOME/share/hadoop/yarn/*<CPS>$HADOOP_YARN_HOME/share/hadoop/yarn/lib/*<CPS>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*<CPS>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*
SPARK_LOG_URL_STDERR -> http://aamir-UX303LAB:8042/node/containerlogs/container_1487575592818_0001_02_000002/hadoop/stderr?start=-4096
SPARK_YARN_STAGING_DIR -> hdfs://localhost:9000/user/hadoop/.sparkStaging/application_1487575592818_0001
SPARK_USER -> hadoop
SPARK_YARN_MODE -> true
PYTHONPATH -> /usr/local/spark/python/lib/py4j-0.10.3-src.zip:/usr/local/spark/python/:<CPS>PWD/pyspark.zip<CPS>PWD/py4j-0.10.3-src.zip
SPARK_LOG_URL_STDOUT -> http://aamir-UX303LAB:8042/node/containerlogs/container_1487575592818_0001_02_000002/hadoop/stdout?start=-4096

command:
JAVA_HOME/bin/java -server -Xmx1024m -Djava.io.tmpdir=PWD/tmp '-Dspark.driver.port=45598' -Dspark.yarn.app.container.log.dir=<LOG_DIR> -XX:OnOutOfMemoryError='kill %p' org.apache.spark.executor.CoarseGrainedExecutorBackend --driver-url spark://CoarseGrainedScheduler@10.0.0.240:45598 --executor-id 1 --hostname aamir-UX303LAB --cores 1 --app-id application_1487575592818_0001 --user-class-path file:$PWD/__app__.jar 1> <LOG_DIR>/stdout 2> <LOG_DIR>/stderr
===============================================================================

17/02/19 23:27:08 INFO impl.ContainerManagementProtocolProxy: Opening proxy : aamir-UX303LAB:45668
17/02/19 23:27:08 INFO yarn.YarnAllocator: Canceling requests for 1 executor container(s) to have a new desired total 2 executors.
17/02/19 23:27:09 INFO yarn.YarnAllocator: Launching container container_1487575592818_0001_02_000003 for on host aamir-UX303LAB
17/02/19 23:27:09 INFO yarn.YarnAllocator: Launching ExecutorRunnable. driverUrl: spark://CoarseGrainedScheduler@10.0.0.240:45598, executorHostname: aamir-UX303LAB
17/02/19 23:27:09 INFO yarn.YarnAllocator: Received 1 containers from YARN, launching executors on 1 of them.
17/02/19 23:27:09 INFO yarn.ExecutorRunnable: Starting Executor Container
17/02/19 23:27:09 INFO impl.ContainerManagementProtocolProxy: yarn.client.max-cached-nodemanagers-proxies : 0
17/02/19 23:27:09 INFO yarn.ExecutorRunnable: Setting up ContainerLaunchContext
17/02/19 23:27:09 INFO yarn.ExecutorRunnable: 
===============================================================================
YARN executor launch context:
env:
CLASSPATH -> PWD<CPS>PWD/__spark_conf__<CPS>PWD/__spark_libs__/*<CPS>$HADOOP_CONF_DIR<CPS>$HADOOP_COMMON_HOME/share/hadoop/common/*<CPS>$HADOOP_COMMON_HOME/share/hadoop/common/lib/*<CPS>$HADOOP_HDFS_HOME/share/hadoop/hdfs/*<CPS>$HADOOP_HDFS_HOME/share/hadoop/hdfs/lib/*<CPS>$HADOOP_YARN_HOME/share/hadoop/yarn/*<CPS>$HADOOP_YARN_HOME/share/hadoop/yarn/lib/*<CPS>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*<CPS>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*
SPARK_LOG_URL_STDERR -> http://aamir-UX303LAB:8042/node/containerlogs/container_1487575592818_0001_02_000003/hadoop/stderr?start=-4096
SPARK_YARN_STAGING_DIR -> hdfs://localhost:9000/user/hadoop/.sparkStaging/application_1487575592818_0001
SPARK_USER -> hadoop
SPARK_YARN_MODE -> true
PYTHONPATH -> /usr/local/spark/python/lib/py4j-0.10.3-src.zip:/usr/local/spark/python/:<CPS>PWD/pyspark.zip<CPS>PWD/py4j-0.10.3-src.zip
SPARK_LOG_URL_STDOUT -> http://aamir-UX303LAB:8042/node/containerlogs/container_1487575592818_0001_02_000003/hadoop/stdout?start=-4096

command:
JAVA_HOME/bin/java -server -Xmx1024m -Djava.io.tmpdir=PWD/tmp '-Dspark.driver.port=45598' -Dspark.yarn.app.container.log.dir=<LOG_DIR> -XX:OnOutOfMemoryError='kill %p' org.apache.spark.executor.CoarseGrainedExecutorBackend --driver-url spark://CoarseGrainedScheduler@10.0.0.240:45598 --executor-id 2 --hostname aamir-UX303LAB --cores 1 --app-id application_1487575592818_0001 --user-class-path file:$PWD/__app__.jar 1> <LOG_DIR>/stdout 2> <LOG_DIR>/stderr
===============================================================================

17/02/19 23:27:09 INFO impl.ContainerManagementProtocolProxy: Opening proxy : aamir-UX303LAB:45668
17/02/19 23:27:09 ERROR yarn.ApplicationMaster: RECEIVED SIGNAL TERM
17/02/19 23:27:09 INFO yarn.ApplicationMaster: Final app status: UNDEFINED, exitCode: 16, (reason: Shutdown hook called before final status was reported.)
17/02/19 23:27:09 INFO yarn.ApplicationMaster: Unregistering ApplicationMaster with UNDEFINED (diag message: Shutdown hook called before final status was reported.)
17/02/19 23:27:09 INFO impl.AMRMClientImpl: Waiting for application to be successfully unregistered.
17/02/19 23:27:09 INFO yarn.ApplicationMaster: Deleting staging directory hdfs://localhost:9000/user/hadoop/.sparkStaging/application_1487575592818_0001
17/02/19 23:27:09 INFO util.ShutdownHookManager: Shutdown hook called
End of LogType:stderr

LogType:stdout
Log Upload Time:Sun Feb 19 23:27:10 -0800 2017
LogLength:0
Log Contents:
End of LogType:stdout

【问题讨论】:

【参考方案1】:

在日志中您可以看到以下警告:

17/02/19 23:26:59 WARN util.Utils:如果需要,请设置 SPARK_LOCAL_IP 绑定到另一个地址

如果你想在yarn-client工作,请设置SPARK_LOCAL_IP

请通过集群查找特定网络接口(可访问)的 IP 来计算 SPARK_LOCAL_IP

http://spark.apache.org/docs/latest/configuration.html

SPARK_LOCAL_IP - 要绑定的机器的 IP 地址。

【讨论】:

感谢您的回复。我已根据您的建议在 spark-env.sh 中设置了 export SPARK_LOCAL_IP=localhost。但是,pyspark shell 仍然没有启动。 pyspark 失败的纱线日志是 here 出于某种原因,设置 SPARK_LOCAL_IP 的警告再次出现在日志中。由于这只是一个警告,您认为这是导致此问题的真正原因吗?感谢您的帮助 @aamirr - 正如我写的那样请通过集群查找特定网络接口(可访问)的 IP 来计算 SPARK_LOCAL_IP。 您应该使用 IP 地址这是集群网络的一部分,例如在集群的同一个netmask @aamirr - 如果你要运行ifconfig,你会得到几个interfacesIPs,你应该选择与集群在同一网络中的IP。 感谢您回答我的问题并耐心等待我。 Here 是 ifconfig 显示的内容,我已经一一使用了 spark-env.sh file 中的两个 IP 地址,并尝试运行 pyspark --master yarn-client。但是应用程序失败了。Here 是 hadoop 页面的屏幕截图,请参阅诊断部分。最后,这是失败的应用程序log 和 bash 终端上的error message。我现在错过了什么?再次感谢。 还有什么遗漏?

以上是关于pyspark shell 未以伪分布式模式启动的主要内容,如果未能解决你的问题,请参考以下文章

如何在以伪分布式模式安装的Hadoop中运行Nutch

Hadoop伪分布模式配置

大数据分析技术:hadoop伪分布模式安装

hadoop 模式下的 Mrjob:启动作业时出错,输入路径错误:文件不存在

用于日志分析的 Map Reduce 作业未在 Hadoop 2.7.3 伪分布式模式下运行

hbase-shell + hbase的java api