Run a Simple Apache Spark App in CDH 5
1,下载解压后进入根目录打包
mvn package
2,To run from a gateway node in a CDH5 cluster:
spark-submit --class com.cloudera.sparkwordcount.SparkWordCount --master local \
target/sparkwordcount-0.0.1-SNAPSHOT.jar <input file> 2
3,This will run the application in a single local process. If the cluster is running a Spark standalone cluster manager, you can replace “–master local” with “–master spark://:”.
If the cluster is running YARN, you can replace “–master local” with “–master yarn”.