通过cloudera manager API重新启动jobtracker

时间:2014-07-28 21:34:56

标签: api hadoop cloudera-manager cloudera-cdh

我正在尝试通过Cloudera Manager API重启Mapreduce Jobtracker。 Jobtracker的统计数据如下:

local-iMac-399:$ curl -u 'admin:admin' 'http://hadoop-namenode.dev.com:7180/api/v6/clusters/Cluster%201/services/mapreduce/roles/mapreduce-JOBTRACKER-0675ebab2b87e3869e0d90167cf4bf86'
{
  "name" : "mapreduce-JOBTRACKER-0675ebab2b87e3869e0d90167cf4bf86",
  "type" : "JOBTRACKER",
  "serviceRef" : {
    "clusterName" : "cluster",
    "serviceName" : "mapreduce"
  },
  "hostRef" : {
    "hostId" : "24259373-7e71-4089-8251-faf055e42ad7"
  },
  "roleUrl" : "http://hadoop-namenode.dev.com:7180/cmf/roleRedirect/mapreduce-JOBTRACKER-0675ebab2b87e3869e0d90167cf4bf86",
  "roleState" : "STARTED",
  "healthSummary" : "GOOD",
  "healthChecks" : [ {
  "name" : "JOB_TRACKER_FILE_DESCRIPTOR",
  "summary" : "GOOD"
}, {
"name" : "JOB_TRACKER_GC_DURATION",
"summary" : "GOOD"
}, {
"name" : "JOB_TRACKER_HOST_HEALTH",
"summary" : "GOOD"
}, {
"name" : "JOB_TRACKER_LOG_DIRECTORY_FREE_SPACE",
"summary" : "GOOD"
}, {
"name" : "JOB_TRACKER_SCM_HEALTH",
"summary" : "GOOD"
}, {
"name" : "JOB_TRACKER_UNEXPECTED_EXITS",
"summary" : "GOOD"
}, {
"name" : "JOB_TRACKER_WEB_METRIC_COLLECTION",
"summary" : "GOOD"
} ],
"configStalenessStatus" : "STALE",
"haStatus" : "ACTIVE",
"maintenanceMode" : false,
"maintenanceOwners" : [ ],
"commissionState" : "COMMISSIONED",
"roleConfigGroupRef" : {
"roleConfigGroupName" : "mapreduce-JOBTRACKER-BASE"
}
}
local-iMac-399:$ 

不知道如何使用API​​重新启动Jobtracker?

我尝试使用以下命令重启Hive服务,但出现了一些错误

local-iMac-399:$curl -X POST -u 'admin:admin'  'http://hadoop-namenode.dev.com:7180/api/v6/clusters/Cluster%201/services/hive/roleCommands/restart'
{
 "message" : "No content to map due to end-of-input\n at [Source: org.apache.cxf.transport.http.AbstractHTTPDestination$1@4169c499; line: 1, column: 1]"
 }

如果有人帮助理解如何使用Cloudera Manager API

,我将不胜感激

1 个答案:

答案 0 :(得分:2)

根据提供的信息,这就是您调用CM API JobTracker重启的方式

curl -u 'admin:admin' -X POST -H "Content-Type:application/json" -d '{"items":["mapreduce-JOBTRACKER-0675ebab2b87e3869e0d90167cf4bf86"]}' 'http://hadoop-namenode.dev.com:7180/api/v6/clusters/Cluster%201/services/mapreduce/roleCommands/restart'