本文是對於本身編譯的Spark部署,若是是CDH集成的Spark則可直接在管理界面中查看。vim
]$ hdfs dfs -mkdir /spark/historylog
]$ vim spark-defaults.conf spark.eventLog.compress true spark.eventLog.dir hdfs://nameservice1/spark/historylog spark.yarn.historyServer.address hadoop002:18080
其中spark.eventLog.dir
保存日誌相關信息的路徑,能夠是hdfs://開頭的HDFS路徑,也能夠是file://開頭的本地路徑,都須要提早建立。oop
]$ vim spark-env.sh export SPARK_HISTORY_OPTS="-Dspark.history.fs.logDirectory=hdfs://mycluster/spark/historylog \ -Dspark.history.ui.port=18080 \ -Dspark.history.retainedApplications=20"
]# ./sbin/start-history-server.sh