以计算PI为例子
进入spark的安装目录
单机local模式提交任务
./bin/spark-submit --class org.apache.spark.examples.SparkPi --master local examples/jars/spark-examples*.jar
yarn-client模式执行计算程序
./bin/spark-submit --class org.apache.spark.examples.SparkPi --master yarn-client examples/jars/spark-examples*.jar
Standalone模式计算
./bin/spark-submit --class org.apache.spark.examples.SparkPi --master spark://masterIp:7077 examples/jars/spark-examples*.jar