File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,13 @@ CLUSTER_NAME=Sandbox
44AMBARI_USER=admin
55AMBARI_PASSWORD=admin
66AMBARI_PORT=8080
7+ AMBARI_PROTOCOL=http
8+ # set to empty if non secure
9+ AMBARI_SECURE=" -s"
710TIMENOW=` date +%Y%m%d_%H%M%S`
811RESULT_DIR=/root/configs
912mkdir -p $RESULT_DIR
10- for CONFIG_TYPE in ` curl -s -u $AMBARI_USER :$AMBARI_PASSWORD http ://$AMBARI_HOST :$AMBARI_PORT /api/v1/clusters/$CLUSTER_NAME /? fields=Clusters/desired_configs | grep ' " : {' | grep -v Clusters | grep -v desired_configs | cut -d' "' -f2` ; do
13+ for CONFIG_TYPE in ` curl -k - s -u $AMBARI_USER :$AMBARI_PASSWORD $AMBARI_PROTOCOL ://$AMBARI_HOST :$AMBARI_PORT /api/v1/clusters/$CLUSTER_NAME /? fields=Clusters/desired_configs | grep ' " : {' | grep -v Clusters | grep -v desired_configs | cut -d' "' -f2` ; do
1114 echo " backuping $CONFIG_TYPE "
12- /var/lib/ambari-server/resources/scripts/configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT get $AMBARI_HOST $CLUSTER_NAME $CONFIG_TYPE | grep ' ^"' | grep -v ' ^"properties" : {' | sed " 1i ##### $CONFIG_TYPE #####" >> $RESULT_DIR /all.conf.$TIMENOW
15+ /var/lib/ambari-server/resources/scripts/configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT $AMBARI_SECURE get $AMBARI_HOST $CLUSTER_NAME $CONFIG_TYPE | grep ' ^"' | grep -v ' ^"properties" : {' | sed " 1i ##### $CONFIG_TYPE #####" >> $RESULT_DIR /all.conf.$TIMENOW
1316done
You can’t perform that action at this time.
0 commit comments