간단한 스파크 잡 실행하기 예제는 다음과 같다.
# 8코어에서 독립 실행 형 모드로 애플리케이션을 실행한다
SPARK_HOME/bin/spark-submit \
--class org.apache.spark.examples.Demo \
--master local[8] \
Demo-0.1-SNAPSHOT-jar-with-dependencies.jar
# YARN 클러스터에서 실행한다
export HADOOP_CONF_DIR=XXX
SPARK_HOME/bin/spark-submit \
--class org.apache.spark.examples.Demo \
--master yarn \
--deploy-mode cluster \ # 클러스터 모드로 클라이언트가 될 수 있다
--executor-memory 20G \
--num-executors 50 \
Demo-0.1-SNAPSHOT-jar-with-dependencies.jar
# supervise 플래그를 포함해 클러스터 배포 모드의 메소스(Mesos) 클러스터에서 실행한다
SPARK_HOME/bin/spark-submit \
--class org.apache.spark.examples.Demo \
--master mesos://207.184.161.138:7077 \ # IP 주소를 사용한다
--deploy-mode cluster \
--supervise \
--executor-memory 20G \
--total-executor-cores 100 \
Demo-0.1-SNAPSHOT-jar-with-dependencies.jar
예제
https://spark.apache.org/docs/2.1.1/submitting-applications.html
# Run application locally on 8 cores
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master local[8] \
/path/to/examples.jar \
100
# Run on a Spark standalone cluster in client deploy mode
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master spark://207.184.161.138:7077 \
--executor-memory 20G \
--total-executor-cores 100 \
/path/to/examples.jar \
1000
# Run on a Spark standalone cluster in cluster deploy mode with supervise
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master spark://207.184.161.138:7077 \
--deploy-mode cluster \
--supervise \
--executor-memory 20G \
--total-executor-cores 100 \
/path/to/examples.jar \
1000
# Run on a YARN cluster
export HADOOP_CONF_DIR=XXX
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master yarn \
--deploy-mode cluster \ # can be client for client mode
--executor-memory 20G \
--num-executors 50 \
/path/to/examples.jar \
1000
# Run a Python application on a Spark standalone cluster
./bin/spark-submit \
--master spark://207.184.161.138:7077 \
examples/src/main/python/pi.py \
1000
# Run on a Mesos cluster in cluster deploy mode with supervise
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master mesos://207.184.161.138:7077 \
--deploy-mode cluster \
--supervise \
--executor-memory 20G \
--total-executor-cores 100 \
http://path/to/examples.jar \
1000
'scala' 카테고리의 다른 글
[spark] log4j 직렬화하기 - org.apache.spark.SparkException: Task not serializable 해결하기 (0) | 2018.03.25 |
---|---|
[spark] 스파크 MLlib으로 비정상 데이터를 찾기에 좋은 참조 자료 (0) | 2018.03.14 |
[play2] 간단한 인증 방식 구현 예제(basic authentication) (0) | 2018.02.20 |
[play] scala play framework에서 인증/권한(authentication/authorization) 참조 문서 - 펌 (0) | 2018.02.09 |
[play] JWT token 예제 (0) | 2018.02.09 |