1、配置 spark-defaults.conf
增加如下配置:
spark.yarn.historyServer.address=phadoop102:18080
spark.history.ui.port=18080
spark.eventLog.enabled true
spark.eventLog.dir hdfs://phadoop102:9000/historyserverforSpark
2、配置spark-env.sh
增加如下配置:
SPARK_HISTORY_OPTS="-Dspark.history.fs.logDirectory=hdfs://phadoop102:9000/historyserverforSpark"
3、测试,打开 history server 地址,如下所示
4、运行程序,比如: