Skip to content

Commit

Permalink
logAnalyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jun 13, 2018
1 parent ca98afb commit 5394dff
Show file tree
Hide file tree
Showing 5 changed files with 540 additions and 0 deletions.
441 changes: 441 additions & 0 deletions logAnalyzer/blueprint/Blueprints.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions logAnalyzer/blueprint/Hostmapping.json
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
]
}


26 changes: 26 additions & 0 deletions logAnalyzer/scripts/installLogSearch.sh
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
32 changes: 32 additions & 0 deletions logAnalyzer/scripts/startLogSearch.sh
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"
31 changes: 31 additions & 0 deletions logAnalyzer/scripts/stopLogSearch.sh
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"

0 comments on commit 5394dff

Please sign in to comment.