Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

amari rest API + how to stop service on specific host

avatar

hi all

 

in ambari we have kafka service , and this service include 7 kafka brokers

 

how to stop/start the kafka broker on specific host?

 

in this example kafka service contain the following kafka broker hosts

 

kafka01

kafka02

kafka03

kafka04

kafka05

kafka06

kafka07

 

other repleted post - https://community.cloudera.com/t5/Support-Questions/how-to-identify-alert-from-kafka-service-in-amba...

 

Capture.PNG

Michael-Bronson
2 ACCEPTED SOLUTIONS

avatar
Master Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Master Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
4 REPLIES 4

avatar
Master Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar

Dear Jay +1 for your excellent answer 

 

I will test this API soon when I will come to office ,  I will update soon

 

Michael-Bronson

avatar

Dear Jay

 

when we run the API we get the following

 

master02 - is the machine with ambari server

kafka01 - is the first kafka machine 

 

where we are wrong ?

 

 

curl -iskH "X-Requested-By: ambari" -u admin:admin -X PUT -d '{"RequestInfo":{"context":"Stop Kafka Broker","operation_level":{"level":"HOST_COMPONENT","cluster_name":"NwCluster","host_name":"kafka01","service_name":"KAFKA"}},"Body":{"HostRoles":{"state":"INSTALLED"}}}' http://master02:8080/api/v1/clusters/HDP_SYS76/hosts/kafka01/host_components/KAFKA_BROKER
HTTP/1.1 404 Not Found
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-store
Pragma: no-cache
Set-Cookie: AMBARISESSIONID=15lniq8gcyggwudtsp5sd70fp;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
User: admin
Content-Type: text/plain
Content-Length: 243

{
"status" : 404,
"message" : "org.apache.ambari.server.controller.spi.NoSuchParentResourceException: Parent Host resource doesn't exist. Host not found, cluster=HDP_SYS76, hostname=kafka01. Host not found, cluster=HDP_SYS76, hostname=kafka01"

Michael-Bronson

avatar
Master Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login