在yarncluster mod中运行python spark作业

2024-05-17 19:18:52 发布

您现在位置:Python中文网/ 问答频道 /正文

当我使用spark run时出现了一个问题圆周率在spark python的示例中,当我使用yarn客户机模式时,一切正常。但是当我使用yarn cluster模式时,作业无法启动,容器返回如下语法错误:

在日志类型:stdout在

日志上传时间:5月4日2015年8月21日08:48:16+0800

在对数长度:111在

日志内容:

“文件”圆周率“,第40行

return 1 if x ** 2 + y ** 2 < 1 else 0

我相信剧本是对的,有人能帮我吗。在


Tags: run示例类型客户机stdout作业时间模式
2条回答

spark目前不支持在集群模式下运行python脚本(将驱动程序部署到集群)

Alternatively, if your application is submitted from a machine far from the worker machines (e.g. locally on your laptop), it is common to use cluster mode to minimize network latency between the drivers and the executors. Note that cluster mode is currently not supported for Mesos clusters or Python applications.

https://spark.apache.org/docs/1.3.1/submitting-applications.html

注意到语法错误是新版本Python中包含的特性,所以我想这可能是Spark使用的Python版本的问题。在

我在中添加了一个属性

/etc/spark/conf.cloudera.spark_on_yarn/spark-defaults.conf:
spark.yarn.appMasterEnv.PYSPARK_PYTHON

指定Python二进制路径。在

相关问题 更多 >