Created
October 16, 2020 06:39
-
-
Save rammanokar/7648077fbe40492e9b35e228a1eaa277 to your computer and use it in GitHub Desktop.
Ambari Start all the services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/env bash | |
| SERVER="xxxxxxxxxx:8080" | |
| AMBARI_ADMIN_USER="admin" | |
| AMBARI_ADMIN_PASSWORD="************" | |
| CLUSTER_NAME="xxxxx" | |
| STATE="STARTED" | |
| generate_post_data() | |
| { | |
| cat <<EOF | |
| { "RequestInfo": | |
| { "context": "_PARSE_.START.ALL_SERVICES", "operation_level": | |
| {"level":"CLUSTER","cluster_name":"${CLUSTER_NAME}"} | |
| },"Body":{"ServiceInfo":{"state":"${STATE}"}}} | |
| EOF | |
| } | |
| curl -i -u ${AMBARI_ADMIN_USER}:${AMBARI_ADMIN_PASSWORD} -H "X-Requested-By: ambari" \ | |
| -X PUT -d "$(generate_post_data)" http://${SERVER}/api/v1/clusters/${CLUSTER_NAME}/services |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment