-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca98afb
commit 5394dff
Showing
5 changed files
with
540 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"blueprint" : "LogSearchBlueprint", | ||
"default_password" : "passw0rd", | ||
"host_groups" :[ | ||
ADD_SERVER | ||
ADD_AGENTS | ||
] | ||
} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
function checkLogSearchStarted(){ | ||
while : | ||
do | ||
if curl -i -u admin:passw0rd -H 'X-Requested-By:ambari' -X GET http://localhost:8080/api/v1/clusters/LogAnalyzer/services/LOGSEARCH 2>&1 | grep "STARTED" > /dev/null 2>&1 | ||
then | ||
break | ||
fi | ||
printf "\n Sleeping 60s \n" | ||
sleep 60s | ||
done | ||
} | ||
|
||
|
||
cd /opt/SupportAssistant/logAnalyzer/blueprint/ | ||
|
||
# Register the Blueprint | ||
curl -H 'X-Requested-By:ambari' -X POST -u admin:passw0rd http://localhost:8080/api/v1/blueprints/LogSearchBlueprint -d @Blueprints.json | ||
|
||
# Deploy the blueprint | ||
curl -H 'X-Requested-By:ambari' -X POST -u admin:passw0rd http://localhost:8080/api/v1/clusters/LogAnalyzer -d @Hostmapping.json | ||
|
||
sleep 120s | ||
|
||
checkLogSearchStarted |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
function checkLogSearchStarted(){ | ||
while : | ||
do | ||
if curl -i -u admin:passw0rd -H 'X-Requested-By:ambari' -X GET http://localhost:8080/api/v1/clusters/LogAnalyzer/services/LOGSEARCH 2>&1 | grep "STARTED" > /dev/null 2>&1 | ||
then | ||
break | ||
fi | ||
printf "\n Sleeping 60s \n" | ||
sleep 60s | ||
done | ||
} | ||
|
||
printf "\n Starting Log Search \n" | ||
|
||
# start service | ||
printf "\n Starting Ambari Infra \n" | ||
curl -u admin:passw0rd -i -H 'X-Requested-By:ambari' -X PUT -d '{"RequestInfo": {"context" :"Start ZOOKEEPER via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' http://localhost:8080/api/v1/clusters/LogAnalyzer/services/ZOOKEEPER | ||
sleep 10s | ||
|
||
printf "\n Starting Zookeeper \n" | ||
curl -u admin:passw0rd -i -H 'X-Requested-By:ambari' -X PUT -d '{"RequestInfo": {"context" :"Start AMBARI_INFRA via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' http://localhost:8080/api/v1/clusters/LogAnalyzer/services/AMBARI_INFRA | ||
sleep 10s | ||
|
||
printf "\n Starting Log Search \n" | ||
curl -u admin:passw0rd -i -H 'X-Requested-By:ambari' -X PUT -d '{"RequestInfo": {"context" :"Sart LOGSEARCH via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' http://localhost:8080/api/v1/clusters/LogAnalyzer/services/LOGSEARCH | ||
sleep 10s | ||
|
||
checkLogSearchStarted | ||
|
||
printf "\n Log Search Started \n" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
|
||
function checkLogSearchStopped(){ | ||
while : | ||
do | ||
if curl -i -u admin:passw0rd -H 'X-Requested-By:ambari' -X GET http://localhost:8080/api/v1/clusters/LogAnalyzer/services/LOGSEARCH 2>&1 | grep "INSTALLED" > /dev/null 2>&1 | ||
then | ||
break | ||
fi | ||
printf "\n Sleeping 60s \n" | ||
sleep 60s | ||
done | ||
} | ||
|
||
printf "\n Stopping Log Search \n" | ||
|
||
#stop service | ||
printf "\n Stopping AMBARI_INFRA \n" | ||
curl -u admin:passw0rd -i -H 'X-Requested-By:ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop AMBARI_INFRA via REST"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' http://localhost:8080/api/v1/clusters/LogAnalyzer/services/AMBARI_INFRA | ||
sleep 10 | ||
|
||
printf "\n Stopping ZOOKEEPER \n" | ||
curl -u admin:passw0rd -i -H 'X-Requested-By:ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop ZOOKEEPER via REST"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' http://localhost:8080/api/v1/clusters/LogAnalyzer/services/ZOOKEEPER | ||
sleep 10s | ||
|
||
printf "\n Stopping LOGSEARCH \n" | ||
curl -u admin:passw0rd -i -H 'X-Requested-By:ambari' -X PUT -d '{"RequestInfo": {"context" :"Stop LOGSEARCH via REST"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' http://localhost:8080/api/v1/clusters/LogAnalyzer/services/LOGSEARCH | ||
|
||
checkLogSearchStopped | ||
|
||
printf "\n Log Search Stopped \n" |