我正在尝试配置提交到群集的pyspark作业。这pyspark公关(https://github.com/apache/spark/pull/2556)表示sc.dump_profiles(path)
是命令。我试图将配置文件输出转储到hadoop hdfs:///user/username/filename
,本地file:///home/username/filename
和/home/username/filename
。工作完成但配置文件从不出现。pyspark的配置文件缺少输出
的代码是基于这太问题(How to profile pyspark jobs),和sc.show_profiles()确实在交互模式下工作包括--conf spark.python.profile=true
时。
from pyspark import SparkContext, SparkConf
import logging
if __name__ == "__main__":
logging.getLogger("py4j").setLevel(logging.ERROR)
conf = SparkConf().setAppName("profile")
sc = SparkContext(conf=conf)
rdd = sc.parallelize(range(100)).map(str)
rdd.count()
sc.show_profiles()
sc.dump_profiles("hdfs:///user/username/python_profiled")
我提交作业这样/opt/spark/bin/spark-submit --verbose --conf spark.python.profile=true --master yarn --deploy-mode cluster --queue production --num-executors 4 test_profile.py
如何格式化path
获取配置文件输出任何指针?