Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

stop cloudera CDH5 cluster command line

I would like to know command line for stopping and starting cloudera CDH5.2 cluster.

Reason, I am writing an automation script for running some benchmark tests and want to stop and start cluster before starting with each benchmark test.

I have seen stopping CDH cluster is not exactly equivalent to :-

service cloudera-scm-server stop

service cloudera-scm-server-db stop

service cloudera-scm-agent stop

like image 663
rational Avatar asked Oct 31 '22 14:10

rational


1 Answers

If you stop the scloudera scm server/agent you will not stop the services. In order to do so:

You need to make a REST request with curl to your cloudera scm server.

The documentation is here: http://cloudera.github.io/cm_api/apidocs/v5/

Here is an example of one of mine:

        PARAM="/api/$CV/clusters/$CLUSTER_NAME/commands/start"
        echo "starting all services"
        curl -X POST -u "$LOGIN:$PASS" "http://""$HOSTNAME""$PARAM"

Don't forget to change your hostname. The hostname point to the cloudera manager server.

You can find the full script I didn't finish, but can help you: http://pastebin.com/d71is5Sx

like image 136
kulssaka Avatar answered Nov 18 '22 20:11

kulssaka