如何在完成并关闭上下文后查看 spark 作业的日志?
How to view the logs of a spark job after it has completed and the context is closed?
我是运行pyspark
,spark 1.3
,standalone mode
,client mode
.
我正在尝试通过查看过去的工作并进行比较来调查我的 spark 工作。我想查看他们的日志、提交作业的配置设置等。但是我 运行 在上下文关闭后查看作业日志时遇到了麻烦。
当我提交作业时,我当然会打开一个 spark 上下文。虽然工作是 运行,但我可以使用 ssh 隧道打开 spark 网络 UI。而且,我可以通过 localhost:<port no>
访问转发端口。然后我可以查看当前 运行 的作业,以及已完成的作业,如下所示:
然后,如果我想查看特定作业的日志,我可以通过使用 ssh 隧道端口转发来查看特定机器的特定端口上用于该作业的日志。
然后,有时作业失败,但上下文仍然打开。发生这种情况时,我仍然可以通过上述方法查看日志。
但是,由于我不想一次打开所有这些上下文,因此当作业失败时,我关闭上下文。当我关闭上下文时,作业出现在上图中的 "Completed Applications" 下方。现在,当我像以前一样尝试使用 ssh 隧道端口转发来查看日志时 (localhost:<port no>
),它给了我一个 page not found
。
如何在上下文关闭后查看作业日志?而且,这意味着 spark context
和日志保存位置之间的关系是什么?谢谢。
再说一遍,我是运行pyspark
,spark 1.3
,standalone mode
,client mode
.
Spark 事件日志/历史服务器适用于此用例。
启用事件日志
如果conf/spark-default.conf
不存在
cp conf/spark-defaults.conf.template conf/spark-defaults.conf
将以下配置添加到conf/spark-default.conf
。
# This is to enabled event log
spark.eventLog.enabled true
// this is where to store event log
spark.eventLog.dir file:///Users/rockieyang/git/spark/spark-events
// this is tell history server where to get event log
spark.history.fs.logDirectory file:///Users/rockieyang/git/spark/spark-events
历史服务器
启动历史服务器
sbin/start-history-server.sh
查看历史,默认端口为18080
我是运行pyspark
,spark 1.3
,standalone mode
,client mode
.
我正在尝试通过查看过去的工作并进行比较来调查我的 spark 工作。我想查看他们的日志、提交作业的配置设置等。但是我 运行 在上下文关闭后查看作业日志时遇到了麻烦。
当我提交作业时,我当然会打开一个 spark 上下文。虽然工作是 运行,但我可以使用 ssh 隧道打开 spark 网络 UI。而且,我可以通过 localhost:<port no>
访问转发端口。然后我可以查看当前 运行 的作业,以及已完成的作业,如下所示:
然后,如果我想查看特定作业的日志,我可以通过使用 ssh 隧道端口转发来查看特定机器的特定端口上用于该作业的日志。
然后,有时作业失败,但上下文仍然打开。发生这种情况时,我仍然可以通过上述方法查看日志。
但是,由于我不想一次打开所有这些上下文,因此当作业失败时,我关闭上下文。当我关闭上下文时,作业出现在上图中的 "Completed Applications" 下方。现在,当我像以前一样尝试使用 ssh 隧道端口转发来查看日志时 (localhost:<port no>
),它给了我一个 page not found
。
如何在上下文关闭后查看作业日志?而且,这意味着 spark context
和日志保存位置之间的关系是什么?谢谢。
再说一遍,我是运行pyspark
,spark 1.3
,standalone mode
,client mode
.
Spark 事件日志/历史服务器适用于此用例。
启用事件日志
如果conf/spark-default.conf
不存在
cp conf/spark-defaults.conf.template conf/spark-defaults.conf
将以下配置添加到conf/spark-default.conf
。
# This is to enabled event log
spark.eventLog.enabled true
// this is where to store event log
spark.eventLog.dir file:///Users/rockieyang/git/spark/spark-events
// this is tell history server where to get event log
spark.history.fs.logDirectory file:///Users/rockieyang/git/spark/spark-events
历史服务器
启动历史服务器
sbin/start-history-server.sh
查看历史,默认端口为18080