cm_api icon indicating copy to clipboard operation
cm_api copied to clipboard

API: /clusters/{clusterName}/services/{serviceName}/yarnApplications

Open Hackeruncle opened this issue 6 years ago • 0 comments

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:

  1. Spark streaming job running is 2 days.

  2. 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

  3. 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.

Hackeruncle avatar May 07 '18 02:05 Hackeruncle