Support Questions

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

Need Guidance : Information of restarts for cloudera services

avatar

Hi

 

Where does Cloudera manager store restart of services information in the database ? We are using the default postgres database.

 

Thanks

 

Srikrishna

1 ACCEPTED SOLUTION

avatar

Hi

 

Thanks . Based on the github  , I am able to get all hosts ,ip . For eg if  some of the hosts are down ,Is there is an API call to check ? 

 

ip hostname down

ip hostname up

 

srikrishna

 

Python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from cm_api.api_client import ApiResource
>>> api = ApiResource('rhel62-1.ent.cloudera.com', 7180, 'admin', 'admin')
>>> for h in api.get_all_hosts():
...   print h.hostname
... 
rhel62-2.ent.cloudera.com
rhel62-4.ent.cloudera.com
rhel62-3.ent.cloudera.com
rhel62-1.ent.cloudera.com
>>> 

 

View solution in original post

4 REPLIES 4

avatar
Master Collaborator

Can you summarise your end goal, so I can provide you with an appropriate information.

avatar

Thanks for your response. We are building a custom UI to display messages when cloudera manager stops/starts the services through API. Is it possible to stop individual services through API. rather than all ? .

 

Is there a specific table it stores relevant data for us to query and check? 

 

We are interested to understand through API., what role each node belongs to ? What is the API call.? 

Sorry for so many questions . I appreciate your response.

avatar
Master Collaborator

Yes you can stop service and it's individual roles via CM API [1] 

 

> Is there a specific table it stores relevant data for us to query and check? 

Service status can be check directly from the CM API querying the relevant endpoint, specifically for the service you'd need to GET (open your browser) to the service endpoint [2] which will give you its state [3]

 

 

As a start point you could see the example [4a][4b]

 

[1] https://github.com/cloudera/cm_api/wiki/Start-Stop-Restart-JobTracker-Role

[2] https://cloudera.github.io/cm_api/apidocs/v11/path__clusters_-clusterName-_services_-serviceName-.ht...

[3] https://cloudera.github.io/cm_api/apidocs/v11/ns0_apiServiceState.html

[4a] https://github.com/cloudera/cm_api/tree/master/python/examples

[4b] https://github.com/gdgt/cmapi

avatar

Hi

 

Thanks . Based on the github  , I am able to get all hosts ,ip . For eg if  some of the hosts are down ,Is there is an API call to check ? 

 

ip hostname down

ip hostname up

 

srikrishna

 

Python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from cm_api.api_client import ApiResource
>>> api = ApiResource('rhel62-1.ent.cloudera.com', 7180, 'admin', 'admin')
>>> for h in api.get_all_hosts():
...   print h.hostname
... 
rhel62-2.ent.cloudera.com
rhel62-4.ent.cloudera.com
rhel62-3.ent.cloudera.com
rhel62-1.ent.cloudera.com
>>>