Skip to content

Instantly share code, notes, and snippets.

@marhan
Created May 11, 2017 15:20
Show Gist options
  • Select an option

  • Save marhan/ab34bae0ca1e96f88038b4e5ab2c7d70 to your computer and use it in GitHub Desktop.

Select an option

Save marhan/ab34bae0ca1e96f88038b4e5ab2c7d70 to your computer and use it in GitHub Desktop.
Starts and stops the Apache Zeppelin application with a standalone Apache Spark cluster
#!/bin/bash
# Configuration
WAIT_SECONDS=2
function start() {
echo
echo "=> Starting spark Master <="
echo
sh ${SPARK_HOME}/sbin/start-master.sh > /dev/null 2>&1
sleep $WAIT_SECONDS
echo
echo "=> Starting spark slave <="
echo
sh ${SPARK_HOME}/sbin/start-slave.sh spark://localhost:7077 > /dev/null 2>&1
sleep $WAIT_SECONDS
echo
echo "=> Starting Zeppelin <="
echo
sh ${ZEPPELIN_HOME}/bin/zeppelin-daemon.sh start > /dev/null 2>&1
echo
echo "=> Spark Standalone Cluster and Zeppelin startet <="
echo
}
function stop() {
echo
echo "=> Stoping Zeppelin <="
echo
sh ${ZEPPELIN_HOME}/bin/zeppelin-daemon.sh stop > /dev/null 2>&1
sleep $WAIT_SECONDS
echo
echo "=> Stoping spark slave <="
echo
sh ${SPARK_HOME}/sbin/stop-slave.sh spark://localhost:7077 > /dev/null 2>&1
sleep $WAIT_SECONDS
echo
echo "=> Stoping spark Master <="
echo
sh ${SPARK_HOME}/sbin/stop-master.sh > /dev/null 2>&1
echo
echo "=> Spark Standalone Cluster and Zeppelin stopped <="
echo
}
case "${1}" in
start)
start
;;
stop)
stop
;;
*)
echo ${USAGE}
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment