Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 12-23-2016 09:28 AM
Hi all! I am new in all this stuff. I am using the latest Sandbox.
I need to start Spark2 service by default. I stopped Spark 1.6 in Ambari (via web interface) and started Spark2 instead.
After that I commit changes to Docker container.
But after restarting - I have Spark 1.6 started again 😞 The same things with my CPU and memory settings.
Could you please guide me to point where I can find settings for Ambari in some configuration file (or something like that).
Thanks a lot in advance!
Created 12-23-2016 06:23 PM
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
Created 12-23-2016 06:23 PM
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