Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

cant delete SPARK2_THRIFTSERVER from node01/03 from ambari

avatar

 

we have two SPARK2_THRIFTSERVER on node01/03 in our ambari server

we want to delete both SPARK2_THRIFTSERVER on both nodes

we try the following API , but without success , any idea where we are wrong?

 

component_name : SPARK2_THRIFTSERVER

 

the REST API: ( we try to delete the thrift server on one of the nodes )

 


curl -iv -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://node02:8080/api/v1/clusters/HDP/hosts/node01/SPARK2_THRIFTSERVER


* About to connect() to node02 port 8080 (#0)
* Connected to node02 (45.3.23.4) port 8080 (#0)
* Server auth using Basic with user 'admin'
> DELETE /api/v1/clusters/HDP/hosts/node01/SPARK2_THRIFTSERVER HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.29.0
> Accept: */*
> X-Requested-By: ambari
>
< HTTP/1.1 404 Not Found
HTTP/1.1 404 Not Found

 

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@mike_bronson7 

I see the difference in the response of the CURL.

HTTP/1.1 404 Not Found                                            [Before]
HTTP/1.1 405 Method Not Allowed                     [Now]

 

I have just tried on my cluster without the -i v and it worked

Worked for me right now

curl  -u admin:admin -H "X-Requested-By: ambari" -X DELETE "http://node02:8080/api/v1/clusters/HDP/hosts/node01/host_components/SPARK2_THRIFTSERVER"

 

Seen a case where with only a -i
curl -i -u admin:admin -H "X-Requested-By: ambari" -X DELETE "http://node02:8080/api/v1/clusters/HDP/hosts/node01/host_components/SPARK2_THRIFTSERVER"

Please revert 

 

View solution in original post

7 REPLIES 7

avatar
Master Mentor

@mike_bronson7 

 

It looks like you forgot a parameter  host_components  assuming the ambari server is running on node2 and the thrift Server is on node01 and node02

 

Delete on Node1

curl -iv -u admin:admin -H "X-Requested-By: ambari" -X DELETE "http://node02:8080/api/v1/clusters/HDP/hosts/node01/host_components/SPARK2_THRIFTSERVER"

 

Delete on Node 2 

curl -iv -u admin:admin -H "X-Requested-By: ambari" -X DELETE

"http://node02:8080/api/v1/clusters/HDP/hosts/node02/host_components/SPARK2_THRIFTSERVER"

HTH

avatar

yes I did it ( i forget to write it in my post ( but cant edit the post )

so after I run it as you wrote still with the same problem

 

< HTTP/1.1 405 Method Not Allowed
HTTP/1.1 405 Method Not Allowed

Michael-Bronson

avatar

I get also

 

<p>The requested method DELETE is not allowed for the URL /api/v1/clusters/............/host_components/SPARK2_THRIFTSERVER.</p>

Michael-Bronson

avatar
Master Mentor

@mike_bronson7 

I see the difference in the response of the CURL.

HTTP/1.1 404 Not Found                                            [Before]
HTTP/1.1 405 Method Not Allowed                     [Now]

 

I have just tried on my cluster without the -i v and it worked

Worked for me right now

curl  -u admin:admin -H "X-Requested-By: ambari" -X DELETE "http://node02:8080/api/v1/clusters/HDP/hosts/node01/host_components/SPARK2_THRIFTSERVER"

 

Seen a case where with only a -i
curl -i -u admin:admin -H "X-Requested-By: ambari" -X DELETE "http://node02:8080/api/v1/clusters/HDP/hosts/node01/host_components/SPARK2_THRIFTSERVER"

Please revert 

 

avatar

 

I change it as your advice but still:

 

curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE "http://node02:8080/api/v1/clusters/HDP/hosts/node01/host_components/SPARK2_THRIFTSERVE"
{
"status" : 404,
"message" : "org.apache.ambari.server.controller.spi.NoSuchResourceException: The specified resource doesn't exist: Service not found, clusterName=HDP, serviceName=component: SPARK2_THRIFTSERVE"

 

.

.note - spark thrift server is on - node01 and on node 03

 

its strange because: ( SPARK2_THRIFTSERVER is the component name ) 

 


curl -u admin:admin -H "X-Requested-By: ambari"-X GET http://node02:8080/api/v1/clusters/HDP/components/ | grep -i spark | grep component_name | tail -1

"component_name" : "SPARK2_THRIFTSERVER",

 

 

Michael-Bronson

avatar

now it works

 

I set FQDN  , incited just node1 

 

Michael-Bronson

avatar
Expert Contributor

@mike_bronson7  The latest command you posted again has typo. "R" is missing at the end in below command -

 

>>curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE "http://node02:8080/api/v1/clusters/HDP/hosts/node01/host_components/SPARK2_THRIFTSERVE"

 

Pls try and pass new error if any.