This task is intended to launch a Spark application. The task submits the Spark application for execution in a Spark cluster. This task is appropriate for a deployments where any file references can be resolved to a shared location.
The spark-cluster task has the following options:
[]
)<none>
)<none>
)<none>
)10000
)1024M
)spark://localhost:7077
)<none>
)<none>
)spark://localhost:6066
)$ ./mvnw clean install -PgenerateApps $ cd apps/spark-cluster-task $ ./mvnw clean package
The following example assumes you have a Spark 1.6.3 cluster running. It also assumes that the app jar resource location is reachable from the cluster. You can store this jar in HDFS.
Run the spark-cluster-task
app using the following command and parameters (we are using a class name of org.apache.spark.examples.JavaSparkPi
for the --spark.app-class
parameter in this example)
java -jar spark-cluster-task-{version}.jar --spark.app-class=org.apache.spark.examples.JavaSparkPi \ --spark.app-jar=/shared/drive/spark-pi-test.jar \ --spark.master=spark://<host>:7077 \ --spark.rest-url=spark://<host>:6066 \ --spark.app-args=10
Then review the stdout log for the finished driver to make sure the app completed.