Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "SPARK_WORKER_DIR=/tmp/sparktest/file/" > $SPARK_HOME/conf/spark-env.sh
- #echo "" > $SPARK_HOME/conf/spark-env.sh
- LOCAL_HOSTNAME=`hostname`
- $SPARK_HOME/sbin/start-master.sh
- echo "sleeping for 10 s"
- sleep 10
- # Try to remove the -d parameter and/or the leading env.var.
- SPARK_WORKER_DIR=/tmp/sparktest/envvar/ $SPARK_HOME/sbin/start-slave.sh 1 spark://$LOCAL_HOSTNAME:7077 -d /tmp/sparktest/cmdline/
- echo "sleeping for 10 s"
- sleep 10
- echo starting
- $SPARK_HOME/bin/spark-submit --class org.apache.spark.examples.SparkPi --master spark://$LOCAL_HOSTNAME:7077 $SPARK_HOME/lib/spark-examples-1.2.0-hadoop2.4.0.jar 100
- echo "sleeping for 10 s"
- sleep 10
- $SPARK_HOME/sbin/spark-daemon.sh stop org.apache.spark.deploy.worker.Worker 1
- $SPARK_HOME/sbin/stop-master.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement