This file contains 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/bash | |
# You must accept the Oracle Binary Code License | |
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html | |
# usage: get_jdk.sh <jdk_version> <ext> | |
# jdk_version: 8(default) or 9 | |
# ext: rpm or tar.gz | |
jdk_version=${1:-8} | |
ext=${2:-rpm} |
This file contains 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
function start(){ | |
curl -u $user:$pass -i -H 'X-Requested-By: ambari' -X PUT -d \ | |
'{"RequestInfo": {"context" :"Start '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' \ | |
http://$host/api/v1/clusters/$cluster/services/$1 | |
} | |
function startWait(){ | |
curl -s -u $user:$pass -H 'X-Requested-By: ambari' -X PUT -d \ | |
'{"RequestInfo": {"context" :"Start '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' \ | |
http://$host/api/v1/clusters/$cluster/services/$1 |
This file contains 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
#!/usr/bin/env bash | |
#get-cmpasswd.sh | |
# password for amon, smon, hmon, rman, nav, scm | |
cat /etc/cloudera-scm-server/db*.properties | sed '/^#/ d' | |
# password for cloudera-scm | |
head -1 /var/lib/cloudera-scm-server-db/data/generated_password.txt | |
# password for hive | |
psql -U scm -W scm -h localhost -p 7432 -c "select attr,value from configs where attr like 'hive_metastore_database%' order by revision_id DESC limit 5;" |