Will try it. Thanks for your response. Thanks Emma From: Qing Chi 79624 <[email protected]<mailto:[email protected]>> Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Date: Thursday, 10 July, 2014 9:23 am To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Cc: Qinghe Jin <[email protected]<mailto:[email protected]>> Subject: Re: Is it OK to delete cluster through rest API?
It is OK to delete cluster through rest API. Stop cluster service before delete. From: Emma Lin <[email protected]<mailto:[email protected]>> Reply-To: <[email protected]<mailto:[email protected]>> Date: Wed, 9 Jul 2014 07:44:08 +0000 To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Cc: Qinghe Jin <[email protected]<mailto:[email protected]>> Subject: Is it OK to delete cluster through rest API? Forward this email to user group for help. Thanks Emma From: Qinghe Jin <[email protected]<mailto:[email protected]>> Date: Wednesday, 9 July, 2014 3:00 pm To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Cc: Kevin Leong <[email protected]<mailto:[email protected]>>, Gavin Lu <[email protected]<mailto:[email protected]>>, VMware <[email protected]<mailto:[email protected]>> Subject: Cannot delete ambari cluster by rest api Hi, I deployed ambari server with the following repo: http://public-repo-1.hortonworks.com/ambari/centos6/1.x/updates/1.6.0/ambari.repo<https://urldefense.proofpoint.com/v1/url?u=http://public-repo-1.hortonworks.com/ambari/centos6/1.x/updates/1.6.0/ambari.repo&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=XFPetyuh5lGv3twiMNs7nw%3D%3D%0A&m=l%2BIbMLSruiJW8dyKO0M%2F7b3eOfOaL6qcy1BIL4i1Hfc%3D%0A&s=fff852109a4329fc1aa85f0ced00ab5a890d589b4fcb77bda5ed0ded15968158> I can stop/start clusters using PUT, but when I try DELETE(curl -i -H 'X-Requested-By: myname' -X DELETE --user admin:admin http://ambari-server:8080/api/v1/clusters/ambari2<https://urldefense.proofpoint.com/v1/url?u=http://ambari-server:8080/api/v1/clusters/ambari2&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=XFPetyuh5lGv3twiMNs7nw%3D%3D%0A&m=l%2BIbMLSruiJW8dyKO0M%2F7b3eOfOaL6qcy1BIL4i1Hfc%3D%0A&s=f97dc6b438fde1d69e06c18960d918bc0977cce5fb8f18c06c9c3ffc9168c079>) to delete cluster, I got the following the error: HTTP/1.1 500 Server Error Set-Cookie: AMBARISESSIONID=f9zpj5aq7ujhvjqaj8bsfac1;Path=/ Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/plain Content-Length: 179 Server: Jetty(7.6.7.v20120910) { "status" : 500, "message" : "org.apache.ambari.server.controller.spi.SystemException: An internal system exception occurred: Could not delete cluster, clusterName=ambari2" } I got the same exception in my java code. I had saw an link for the problem: http://hortonworks.com/community/forums/topic/delete-cluster/<https://urldefense.proofpoint.com/v1/url?u=http://hortonworks.com/community/forums/topic/delete-cluster/&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=XFPetyuh5lGv3twiMNs7nw%3D%3D%0A&m=l%2BIbMLSruiJW8dyKO0M%2F7b3eOfOaL6qcy1BIL4i1Hfc%3D%0A&s=ebac7b4a206f152eff1222e05c7b073dcc19d98ec9766d8add73b31e4806ed9f> In the old link, it seems that the delete-cluster is forbidden on purpose. For the work around(run ambari-server reset cmd), it's not easy for us to use directly. I wonder if there is other ways to delete the cluster? Does I using the wrong way to delete the cluster? I just follow the doc on this page: https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md<https://urldefense.proofpoint.com/v1/url?u=https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=XFPetyuh5lGv3twiMNs7nw%3D%3D%0A&m=l%2BIbMLSruiJW8dyKO0M%2F7b3eOfOaL6qcy1BIL4i1Hfc%3D%0A&s=0f17fdc28c3ded7a2eed45b8524f707426121ec17df01fddfce92447f1a83938> If there is no other ways to delete the cluster, is there any plan to enable the rest api in the future? Sincerely, Qinghe
