Spark driver的初始化主要围绕SparkContext的初始化,SparkContext初始化完之后,才能向Spark集群提交任务。
- spark context初始化
// Create and start the scheduler
val (sched, ts) = SparkContext.createTaskScheduler(this, master, deployMode) ///创建任务调度器
_schedulerBackend = sched
#!/bin/bash | |
if ! [ $# -eq 1 ]; then | |
echo "Usage: $0 <node-name>" | |
exit 1 | |
fi | |
# Directory where everything happens | |
DIR=~/work/virt-install | |
# The image downloaded from the http://fedoraproject.org/en/get-fedora#clouds site |
Exception in thread "main" org.apache.spark.SparkException: A master URL must be set in your configuration
VM options启动参数增加:
-Dspark.master=local