Stop cloudera CDH5 cluster command line

I would like to know the command line to stop and start a CDH5 cluster. 2.

Reason: I am writing an automation script to run some test cases and want to stop and start the cluster before starting each test case.

I saw that stopping the CDH cluster is not exactly equivalent: -

cloudera-scm-server stop service

cloudera-scm-server-db stop service

cloudera-scm-agent stop service

+3


source to share


1 answer


If you stop scmoudera scm server / agent, you will not stop services. For this:

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

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

Here's 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 the hostname. The hostname points to the cloudera manager server.

You can find the complete script, I am not finished, but I can help you: http://pastebin.com/d71is5Sx

+1


source







All Articles