0

我正在尝试通过 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,我将不胜感激

4

1 回答 1

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'
于 2014-09-20T22:13:34.273 回答