该问题可能是由于历史服务器没有正确配置相关参数所致。要解决此问题,请按照以下步骤操作:
--conf spark.eventLog.enabled=true --conf spark.eventLog.dir=<指定事件日志目录>
--conf spark.history.fs.logDirectory=<指定事件日志目录> --conf spark.history.ui.maxApplications=<限制Spark应用程序显示的数量>
--conf spark.ui.allowSparkContext=<设置为true>
代码示例:
启动Spark应用程序:
spark-shell --conf spark.eventLog.enabled=true --conf spark.eventLog.dir=/tmp/spark-events
启动Spark历史服务器:
/usr/local/spark/sbin/start-history-server.sh --conf spark.history.fs.logDirectory=/tmp/spark-events --conf spark.history.ui.maxApplications=10
访问Spark历史服务器UI:
http://localhost:18080
修改参数:
/usr/local/spark/sbin/start-history-server.sh --conf spark.history.fs.logDirectory=/tmp/spark-events --conf spark.history.ui.maxApplications=10 --conf spark.ui.allowSparkContext=true