spark.sh 697 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env sh
  2. set -e
  3. start_share_spark()
  4. {
  5. share $SPARK_HOME spark
  6. }
  7. stop_share_spark()
  8. {
  9. true
  10. }
  11. start_spark()
  12. {
  13. if [ "$1" == "share" ]; then
  14. start_share_spark
  15. fi
  16. $SPARK_HOME/sbin/start-all.sh
  17. }
  18. stop_spark()
  19. {
  20. $SPARK_HOME/sbin/stop-all.sh &
  21. }
  22. start_spark_log()
  23. {
  24. if [ "$1" == "share" ]; then
  25. start_share_spark
  26. fi
  27. check hadoop
  28. hadoop_mkdir spark spark/jars spark/log
  29. hadoop fs -put -f /usr/local/spark/jars/* /spark/jars/ &
  30. }
  31. stop_spark_log()
  32. {
  33. true
  34. }
  35. spark_test_pi()
  36. {
  37. spark-submit --class org.apache.spark.examples.SparkPi --master yarn --deploy-mode client /usr/local/spark/examples/jars/spark-examples_2.11-2.1.1.jar
  38. }