使用ambari删除服务时出错

时间:2015-08-11 18:14:35

标签: hadoop ambari

我正在尝试删除无法正确安装的服务,以便我可以尝试重新安装。

我在ambari UI中找不到任何删除选项,因此我尝试使用API​​删除。但是,我点击了一条错误消息:

[root@rvm /]# ambari-server --version
1.7.0_IBM

我正在使用docker化版本的IBM Open Platform v4,即IOP_v4000_20150.zip

ambari版本是:

curl -u admin:admin -H 'X-Requested-By:ambari' -X GET \
     'http://localhost:8080/api/v1/clusters/BI4_QSE/services/SPARK'
{
  "href" : "http://localhost:8080/api/v1/clusters/BI4_QSE/services/SPARK",
  "ServiceInfo" : {
    "cluster_name" : "BI4_QSE",
    "maintenance_state" : "OFF",
    "service_name" : "SPARK",
    "state" : "INSTALLED"
  },
  "components" : [
    {
      "href" : "http://localhost:8080/api/v1/clusters/BI4_QSE/services/SPARK/components/SPARK_CLIENT",
      "ServiceComponentInfo" : {
        "cluster_name" : "BI4_QSE",
        "component_name" : "SPARK_CLIENT",
        "service_name" : "SPARK"
      }
    },
    {
      "href" : "http://localhost:8080/api/v1/clusters/BI4_QSE/services/SPARK/components/SPARK_JOBHISTORYSERVER",
      "ServiceComponentInfo" : {
        "cluster_name" : "BI4_QSE",
        "component_name" : "SPARK_JOBHISTORYSERVER",
        "service_name" : "SPARK"
      }
    },
    {
      "href" : "http://localhost:8080/api/v1/clusters/BI4_QSE/services/SPARK/components/SPARK_THRIFTSERVER",
      "ServiceComponentInfo" : {
        "cluster_name" : "BI4_QSE",
        "component_name" : "SPARK_THRIFTSERVER",
        "service_name" : "SPARK"
      }
    }
  ]
}

以下是GET命令的输出:

The report execution eqaiekfzmk2snc55y0zrow55 has expired or cannot be found. (rsExecutionNotFound)

问题:如何删除并重新安装spark?

1 个答案:

答案 0 :(得分:5)

您应该能够运行以下命令序列来停止然后删除SPARK。

以下命令将状态设置为INSTALLED,也就是确保它不是RUNNING。

curl -i -H "X-Requested-By: ambari" -u admin:admin -X PUT \
     -d '{"RequestInfo":{"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' \
     http://localhost:8080/api/v1/clusters/BI4_QSE/services/SPARK

接下来的几个命令将确保每个组件都停止。

 curl -i -H "X-Requested-By: ambari" -u admin:admin -X PUT \
      -d '{"RequestInfo":{"context":"Stop All Components"},"Body":{"ServiceComponentInfo":{"state":"INSTALLED"}}}' \
      http://localhost:8080/api/v1/clusters/BI4_QSE/services/SPARK/components/SPARK_THRIFTSERVER

 curl -i -H "X-Requested-By: ambari" -u admin:admin -X PUT \
      -d '{"RequestInfo":{"context":"Stop All Components"},"Body":{"ServiceComponentInfo":{"state":"INSTALLED"}}}' \
      http://localhost:8080/api/v1/clusters/BI4_QSE/services/SPARK/components/SPARK_JOBHISTORYSERVER

最后,您可以通过执行以下命令来删除该服务:

 curl -i -H "X-Requested-By: ambari" -u admin:admin -X DELETE \ 
      http://localhost:8080/api/v1/clusters/BI4_QSE/services/SPARK

然后,您可以使用'添加服务'重新安装SPARK。 Ambari UI中的向导。