spark-env.sh
export SPARK_HISTORY_OPTS="-Dspark.history.retainedApplications=50-Dspark.history.fs.logDirectory=hdfs://node04:9000/directory"
#spark.history.retainedApplications:仅显示最近50个应用
#spark.history.fs.logDirectory:Spark History Server只显示该路径下的信息
spark-defaults.conf
spark.eventLog.enabled true
spark.eventLog.dir hdfs://node04:8020/directory
#应用在运行过程中所有的信息均记录在该属性指定的路径下
spark.eventLog.compress true
HistoryServer启动
$SPARK_HOMR/bin/start-histrory-server.sh
HistoryServer停止
$SPARK_HOMR/bin/stop-histrory-server.sh
来源:oschina
链接:https://my.oschina.net/u/4427158/blog/3165814