执行命令
jar tf examples/jars/spark-examples_2.11-2.1.0.jar | grep SparkPi
# 集群:
./bin/spark-submit --class org.apache.spark.examples.SparkPi --master spark://10.0.177.242:7077 examples/jars/spark-examples_2.11-2.1.0.jar
# 本地
./bin/spark-submit --class org.apache.spark.examples.SparkPi --master local examples/jars/spark-examples_2.11-2.1.0.jar
yarn 执行
export HADOOP_CONF_DIR=/usr/local/hadoop/hadoop-2.7.3/etc/hadoop
./bin/spark-submit --class org.apache.spark.examples.SparkPi --master yarn-client examples/jars/spark-examples_2.11-2.1.0.jar
# 查看日志
../hadoop-2.7.3/bin/yarn logs --applicationId application_xxxxx
yarn 上启动 spark-shell
./bin/spark-shell --master yarn-client