可以使用历史日志服务器查看以前的job执行日志
临时配置,对本次提交的应用程序起作用:
./spark-shell --master spark://node1:7077
--name myapp1
--conf spark.eventLog.enabled=true
--conf spark.eventLog.dir=hdfs://node1:9000/spark/test
停止程序,在 Web Ui 中 Completed Applications 对应的
ApplicationID 中能查看 history。
永久配置:
spark-default.conf 配置文件中配置 HistoryServer,对所有提交
的 Application 都起作用
在客户端节点,进入…/spark-3.0.1/conf/ spark-defaults.conf 最
后加入:
//开启记录事件日志的功能
spark.eventLog.enabled true
//设置事件日志存储的目录
spark.eventLog.dir hdfs://node1:9000/spark/test
//设置 HistoryServer 加载事件日志的位置
spark.history.fs.logDirectory hdfs://node1:9000/spark/test
//日志优化选项,压缩日志
spark.eventLog.compress true
重启即可在浏览器访问查看: