$ cp /{base_dir}/spark3/conf/workers.template /{base_dir}/spark3/conf/workers
$ vi /{base_dir}/spark3/conf/workers
{Worker 1 Host Name}
{Worker 2 Host Name}
{Worker 3 Host Name}
$ scp -r /{base_dir}/spark3 {OS User Name}@{Worker 1 Host Name}:/{base_dir}
$ scp -r /{base_dir}/spark3 {OS User Name}@{Worker 2 Host Name}:/{base_dir}
$ scp -r /{base_dir}/spark3 {OS User Name}@{Worker 3 Host Name}:/{base_dir}
$ /{base_dir}/spark3/sbin/stop-all.sh
$ /{base_dir}/spark3/sbin/start-all.sh
변경된 각 Port에 대해서 EC2 보안그룹에서 Inbound Rules 편집
$ vi /{base_dir}/spark3/conf/spark-env.sh
JAVA_HOME=/{base_dir}/jdk8
SPARK_MASTER_PORT=**** # default: 7077
SPARK_MASTER_WEBUI_PORT=**** # default: 8080
SPARK_WORKER_PORT=**** # default: random
SPARK_WORKER_WEBUI_PORT=**** # default: 8081
SPARK_WORKER_CORES=8 # default: all available
SPARK_WORKER_MEMORY=8G # default: machine's total RAM minus 1 GiB
SPARK_PUBLIC_DNS=${HOSTNAME}
$ scp -r /{base_dir}/spark3 {OS User Name}@{Worker 1 Host Name}:/{base_dir}
$ scp -r /{base_dir}/spark3 {OS User Name}@{Worker 2 Host Name}:/{base_dir}
$ scp -r /{base_dir}/spark3 {OS User Name}@{Worker 3 Host Name}:/{base_dir}
$ /{base_dir}/spark3/sbin/stop-all.sh
$ /{base_dir}/spark3/sbin/start-all.sh
$ cd /{base_dir}/spark3
$ ./bin/spark-shell --help
$ ./bin/spark-shell --master spark://{Master Host Name}:{SPARK_MASTER_PORT}
$ cd /{base_dir}/spark3
$ ./bin/spark-shell --help
$ ./bin/spark-shell --master spark://{Master Host Name}:{SPARK_MASTER_PORT} --executor-memory 2G --executor-cores 2 --total-executor-cores 12
$ vi /{base_dir}/spark3/conf/spark-env.sh
JAVA_HOME=/{base_dir}/jdk8
SPARK_MASTER_PORT=**** # default: 7077
SPARK_MASTER_WEBUI_PORT=**** # default: 8080
SPARK_WORKER_PORT=**** # default: random
SPARK_WORKER_WEBUI_PORT=**** # default: 8081
SPARK_WORKER_CORES=8 # default: all available
SPARK_WORKER_MEMORY=8G # default: machine's total RAM minus 1 GiB
SPARK_PUBLIC_DNS=${HOSTNAME}
SPARK_MASTER_OPTS="-Dspark.deploy.defaultCores=5" # total core w/o --total-executor-cores
$ scp -r /{base_dir}/spark3 {OS User Name}@{Worker 1 Host Name}:/{base_dir}
$ scp -r /{base_dir}/spark3 {OS User Name}@{Worker 2 Host Name}:/{base_dir}
$ scp -r /{base_dir}/spark3 {OS User Name}@{Worker 3 Host Name}:/{base_dir}
$ /{base_dir}/spark3/sbin/stop-all.sh
$ /{base_dir}/spark3/sbin/start-all.sh
$ ./bin/spark-shell --master spark://{Master Host Name}:{SPARK_MASTER_PORT}