cm_api
cm_api copied to clipboard
API: /clusters/{clusterName}/services/{serviceName}/yarnApplications
API: /clusters/{clusterName}/services/{serviceName}/yarnApplications CDH: 5.12
I want to use the cm api , check this job is still running or not running.
Steps:
-
Spark streaming job running is 2 days.
-
Shell: JOB_NAME=SparkStreamingJob curl -u $CDHUSER:$CDHPASSWORD $CDHURL/api/v17/clusters/JYDWCluster/services/yarn/yarnApplications > cdh.json cat cdh.json | grep -A 4 $JOB_NAME > job.log RUNNINGNUM=
cat job.log | grep "state" | grep "RUNNING" | wc -l
-
In most cases, this job is existed in the cm api result. But ,once in a while, this job is not existed in the cm api result, is strange. I suspect it's a bug.