Rest API

spark可以通过UI查看指标。这样就能开发一些可视化图表工具来收集展示所有任务的概况,这样就能从整体上看到集群的运行情况,以及业务的增长情况。这些命令同时也只支持正在运行的应用。对于history server,访问的地址是http://:18080/api/v1,对于正在运行的任务,可以访问http://localhost:4040/api/v1

在这些api中,应用的标识为ID[app-id]。当通过YARN启动时,每个应用可能会有多次尝试,只有在cluster模式下才有 应用尝试的id,client模式是没有的。如果是集群模式,那么app-id其实是[base-app-id]/[attempt-id],其中base-app-id是yarn的appid

?status=[active|complete|pending|failed] 可以列出对应的状态

端点含义
/applications所有应用的列表
/applications/[app-id]/jobs给定应用的全部作业列表
/applications/[app-id]/jobs/[job-id]给定作业的细节
/applications/[app-id]/stages给定应用的stage列表
/applications/[app-id]/stages/[stage-id]给定stage的所有attempt列表
/applications/[app-id]/stages/[stage-id]/[stage-attempt-id]给定attempt的详细信息
/applications/[app-id]/stages/[stage-id]/[stage-attempt-id]/taskSummary指定attempt对应的所有task的概要度量信息
/applications/[app-id]/stages/[stage-id]/[stage-attempt-id]/taskList指定的attempt的所有task的列表
/applications/[app-id]/executors给定应用的所有执行器
/applications/[app-id]/storage/rdd给定应用的已保存的RDD列表
/applications/[app-id]/storage/rdd/[rdd-id]给定的RDD的存储详细信息
/applications/[app-id]/logs将给定应用的所有attempt对应的event log以zip格式打包下载
/applications/[app-id]/[attempt-id]/logs将给定attempt的所有attempt对应的event log以zip格式打包下载

API链接: https://spark.apache.org/docs/2.2.0/monitoring.html#rest-api.

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐