gpt4 book ai didi

hadoop - 使用 ambari 删除服务时出错

转载 作者:可可西里 更新时间:2023-11-01 15:01:20 32 4
gpt4 key购买 nike

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

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

curl -u admin:admin -H 'X-Requested-By:ambari' -X DELETE \
'http://localhost:8080/api/v1/clusters/BI4_QSE/services/SPARK'
{
"status" : 500,
"message" : "org.apache.ambari.server.controller.spi.SystemException:
An internal system exception occurred: Cannot remove SPARK.
Desired state STARTED is not removable.
Service must be stopped or disabled."
}

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

ambari 版本是:

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

下面是 GET 命令的输出:

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"
}
}
]
}

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

最佳答案

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

以下命令会将状态设置为已安装,也就是确保其未运行。

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

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

关于hadoop - 使用 ambari 删除服务时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31949091/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com