看不到Spark gc日志

时间:2016-09-23 13:08:24

标签: apache-spark

我用这个提交了我的jar文件:

-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+UseCompressedOops

您可以看到我按照官方文档中的建议添加了stdout部分。但是,当我在Web UI中查看从属设备“stderrlog4j.properties.template时,我看不到垃圾收集。

是否阻止显示gc日志的log4j设置?我的spark conf目录中只有import csv from datetime import datetime today = datetime.now().date().strftime("%d-%B-%Y") while True: with open("InputFile.csv") as d: has_birthday = [user for user, birthday, gender in csv.reader(d,skipinitialspace=True) if birthday == today] if len(has_birthday) < 1: exit () else: with open("InputFile.csv") as f: has_birthday = [user for user, birthday, gender in csv.reader(f,skipinitialspace=True) if birthday == today] with open("InputFile.csv") as g: male = [user for user, birthday, gender in csv.reader(g, delimiter=',', skipinitialspace=True) if birthday == today and gender == 'M'] with open("InputFile.csv") as h: female = [user for user, birthday, gender in csv.reader(h, delimiter=',', skipinitialspace=True) if birthday == today and gender == 'F'] if len(has_birthday) == 1 and male: frm = "{} has his birthday today." elif len(has_birthday) == 1 and female: frm = "{} has her birthday today." else: frm = "{} have their birthdays today." test = (frm.format(" and ".join([", ".join(has_birthday[:-1]), has_birthday[-1]]))) if len(has_birthday) > 1 else frm.format(" and ".join(has_birthday)) print test 文件。

关于什么是错的任何建议?谢谢。

1 个答案:

答案 0 :(得分:0)

根据https://databricks.com/blog/2015/05/28/tuning-java-garbage-collection-for-spark-applications.html - GC日志写入: $SPARK_HOME/work/$app_id/$executor_id/stdout

尝试使用此页面上建议的设置配置您的spark应用,并查看它是否按预期工作。