<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to clear / remove the failed host components / services after failed installation in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-clear-remove-the-failed-host-components-services/m-p/165946#M37006</link>
    <description>&lt;P&gt;Hi can you try this command:&lt;/P&gt;&lt;P&gt;curl -u admin:admin -i -H 'X-Requested-By: ambari' -X DELETE &lt;A href="http://mgmt.example.com:8080/api/v1/clusters/supportLab/services/SMARTSENSE"&gt;http://AMBAIRHOST:8080/api/v1/clusters/CLUSTERNAME/services/&lt;/A&gt;HIVE&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2016 10:57:23 GMT</pubDate>
    <dc:creator>sganatra</dc:creator>
    <dc:date>2016-08-05T10:57:23Z</dc:date>
    <item>
      <title>How to clear / remove the failed host components / services after failed installation</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-clear-remove-the-failed-host-components-services/m-p/165945#M37005</link>
      <description>&lt;P&gt;HI &lt;/P&gt;&lt;P&gt;I tried installing the services HIVE, TEZ, PIG to the existing cluster and it got failed. I wanted to remove / clean up the components and services. In the Since the installation is failed, i could not find the component to decommission and then remove. Only HCAT got installed. Tried through API to remove the service, it is getting failed with the below error.&lt;/P&gt;&lt;P&gt;CSRF option is not in ambari.properties file as well. &lt;/P&gt;&lt;P&gt;$ cat /etc/ambari-server/conf/ambari.properties | grep -i CSR
[root@ip-172-27-3-42.ap-southeast-1.compute.internal]:/home/ambari
$&lt;/P&gt;&lt;PRE&gt;$ curl -u admin:xxxx -H “X-Requested-By: ambari” -X GET &lt;A href="http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE" target="_blank"&gt;http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE&lt;/A&gt;
curl: (6) Could not resolve host: xn--ambari-1i0c; Name or service not known
{
  "href" : "http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE",
  "ServiceInfo" : {
    "cluster_name" : "eim_edl_dev_cluster_1",
    "maintenance_state" : "OFF",
    "service_name" : "HIVE",
    "state" : "INSTALL_FAILED"
  },
  "alerts_summary" : {
    "CRITICAL" : 0,
    "MAINTENANCE" : 0,
    "OK" : 0,
    "UNKNOWN" : 0,
    "WARNING" : 0
  },
  "alerts" : [ ],
  "components" : [
    {
      "href" : "http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE/components/HCAT",
      "ServiceComponentInfo" : {
        "cluster_name" : "eim_edl_dev_cluster_1",
        "component_name" : "HCAT",
        "service_name" : "HIVE"
      }
    },
    {
      "href" : "http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE/components/HIVE_CLIENT",
      "ServiceComponentInfo" : {
        "cluster_name" : "eim_edl_dev_cluster_1",
        "component_name" : "HIVE_CLIENT",
        "service_name" : "HIVE"
      }
    },
    {
      "href" : "http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE/components/HIVE_METASTORE",
      "ServiceComponentInfo" : {
        "cluster_name" : "eim_edl_dev_cluster_1",
        "component_name" : "HIVE_METASTORE",
        "service_name" : "HIVE"
      }
    },
    {
      "href" : "http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE/components/HIVE_SERVER",
      "ServiceComponentInfo" : {
        "cluster_name" : "eim_edl_dev_cluster_1",
        "component_name" : "HIVE_SERVER",
        "service_name" : "HIVE"
      }
    },
    {
      "href" : "http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE/components/MYSQL_SERVER",
      "ServiceComponentInfo" : {
        "cluster_name" : "eim_edl_dev_cluster_1",
        "component_name" : "MYSQL_SERVER",
        "service_name" : "HIVE"
      }
    },
    {
      "href" : "http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE/components/WEBHCAT_SERVER",
      "ServiceComponentInfo" : {
        "cluster_name" : "eim_edl_dev_cluster_1",
        "component_name" : "WEBHCAT_SERVER",
        "service_name" : "HIVE"
      }
    }
  ],
  "artifacts" : [ ]

======================================

$ curl -u admin:xxxxx -H “X-Requested-By: ambari” -X DELETE &lt;A href="http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE" target="_blank"&gt;http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE&lt;/A&gt;
curl: (6) Could not resolve host: xn--ambari-1i0c; Name or service not known
{
  "status" : 400,
  "message" : "CSRF protection is turned on. X-Requested-By HTTP header is required."

$ curl -u admin:xxxxx -H “X-Requested-By: ambari” -X DELETE -d ‘{“RequestInfo”:{“state”:”INSTALL_FAILED”}}’ &lt;A href="http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE" target="_blank"&gt;http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE&lt;/A&gt;
curl: (6) Could not resolve host: xn--ambari-1i0c; Name or service not known
{
  "status" : 400,
  "message" : "CSRF protection is turned on. X-Requested-By HTTP header is required.&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Aug 2016 10:54:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-clear-remove-the-failed-host-components-services/m-p/165945#M37005</guid>
      <dc:creator>muthukumar_siva</dc:creator>
      <dc:date>2016-08-05T10:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear / remove the failed host components / services after failed installation</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-clear-remove-the-failed-host-components-services/m-p/165946#M37006</link>
      <description>&lt;P&gt;Hi can you try this command:&lt;/P&gt;&lt;P&gt;curl -u admin:admin -i -H 'X-Requested-By: ambari' -X DELETE &lt;A href="http://mgmt.example.com:8080/api/v1/clusters/supportLab/services/SMARTSENSE"&gt;http://AMBAIRHOST:8080/api/v1/clusters/CLUSTERNAME/services/&lt;/A&gt;HIVE&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 10:57:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-clear-remove-the-failed-host-components-services/m-p/165946#M37006</guid>
      <dc:creator>sganatra</dc:creator>
      <dc:date>2016-08-05T10:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear / remove the failed host components / services after failed installation</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-clear-remove-the-failed-host-components-services/m-p/165947#M37007</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/5283/sganatra.html" nodeid="5283"&gt;@sganatra&lt;/A&gt; &lt;/P&gt;&lt;P&gt;curl -u admin:xxxx -i -H “X-Requested-By: ambari” -X DELETE &lt;A href="http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE" target="_blank"&gt;http://172.27.3.42:8080/api/v1/clusters/eim_edl_dev_cluster_1/services/HIVE&lt;/A&gt;
curl: (6) Could not resolve host: xn--ambari-1i0c; Name or service not known
HTTP/1.1 400 Bad Request
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
User: admin
Set-Cookie: AMBARISESSIONID=huz7jn29p3fggsw2xggfqto;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/plain
Content-Length: 107
Server: Jetty(8.1.17.v20150415)

{
  "status" : 400,
  "message" : "CSRF protection is turned on. X-Requested-By HTTP header is required."&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 13:36:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-clear-remove-the-failed-host-components-services/m-p/165947#M37007</guid>
      <dc:creator>muthukumar_siva</dc:creator>
      <dc:date>2016-08-05T13:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear / remove the failed host components / services after failed installation</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-clear-remove-the-failed-host-components-services/m-p/165948#M37008</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10949/muthukumarsiva.html" nodeid="10949"&gt;@Muthukumar S&lt;/A&gt; : The issue is with the double quotes you used around X-Requested-By: ambari. When I tried copy pasting the url you have pasted, I got the same issue as you.&lt;/P&gt;&lt;P&gt; I tried with single quotes like :&lt;/P&gt;&lt;P&gt;curl -u admin:admin -H 'X-Requested-By: ambari' -X DELETE -d ‘{“RequestInfo”:{“state”:”INSTALL_FAILED”}}’ &lt;A href="http://172.22.127.69:8080/api/v1/clusters/cl1/services/HIVE" target="_blank"&gt;http://172.22.127.69:8080/api/v1/clusters/cl1/services/HIVE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and it worked.&lt;/P&gt;&lt;P&gt;Have you used an editor which does a formatting because it looks like the quotes you used were special quotes which lead to the header not being read by curl.&lt;/P&gt;&lt;P&gt;Here is a link on how to delete a service. You will not be able to delete the service if it has components installed. The link has commands to delete components as well :&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/AMBARI/Using+APIs+to+delete+a+service+or+all+host+components+on+a+host" target="_blank"&gt;https://cwiki.apache.org/confluence/display/AMBARI/Using+APIs+to+delete+a+service+or+all+host+components+on+a+host&lt;/A&gt;&lt;/P&gt;&lt;P&gt;PS : Make sure when you copy/paste, you replace the double quotes in the terminal or a reliable editor.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 13:39:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-clear-remove-the-failed-host-components-services/m-p/165948#M37008</guid>
      <dc:creator>sbhat</dc:creator>
      <dc:date>2016-08-05T13:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear / remove the failed host components / services after failed installation</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-clear-remove-the-failed-host-components-services/m-p/165949#M37009</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1902/sbhat.html" nodeid="1902"&gt;@sbhat&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It worked, awesome. Thanks a lot. 
&lt;A rel="user" href="https://community.cloudera.com/users/1902/sbhat.html" nodeid="1902"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 14:31:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-clear-remove-the-failed-host-components-services/m-p/165949#M37009</guid>
      <dc:creator>muthukumar_siva</dc:creator>
      <dc:date>2016-08-05T14:31:15Z</dc:date>
    </item>
  </channel>
</rss>

