Member since
12-23-2016
9
Posts
1
Kudos Received
0
Solutions
12-23-2016
06:23 PM
@Yurii Tymchii The issue you are seeing is the sandbox uses a start script (/etc/init.d/startup_script) to start the services, but it really just calls a chain of other scripts. Even though you have stopped Spark 1.6, when the sandbox starts up again it makes the call to start Spark 1.6 automatically. I haven't yet found exactly where Spark is starting. As I said, the chain of script calling is a little more complex than I expected. What I do in my sandboxes is to create a couple of scripts that use the Ambari REST API to start/stop extra services. I'm not using Flume, so I created a script called "stop_flume.sh" on my sandbox. After I run the startup_script, I then run the stop_flume.sh script. Here is my script: USERNAME=admin
PASSWORD=admin
CLUSTER=Sandbox
echo "Stopping FLUME"
# Turn off maintenance mode
curl -u $USERNAME:$PASSWORD -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Turn OFF Maintenance Mode for FLUME via REST"}, "Body": {"ServiceInfo": {"maintenance_state": "OFF"}}}' http://`hostname -f`:8080/api/v1/clusters/$CLUSTER/services/FLUME
sleep 5
# Stopping a service is actually setting the state to INSTALLED
curl -u $USERNAME:$PASSWORD -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Start FLUME via REST"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}' http://`hostname -f`:8080/api/v1/clusters/$CLUSTER/services/FLUME
sleep 5
# Turn on maintenance mode
curl -u $USERNAME:$PASSWORD -i -H 'X-Requested-By: ambari' -X PUT -d '{"RequestInfo": {"context" :"Turn OFF Maintenance Mode for FLUME via REST"}, "Body": {"ServiceInfo": {"maintenance_state": "ON"}}}' http://`hostname -f`:8080/api/v1/clusters/$CLUSTER/services/FLUME
... View more
01-27-2017
04:19 PM
Could you please provide examples according to : < 2. You can use ambari blueprint to start and stop the services.> Thanks
... View more