티스토리 뷰
Spark Application 을 작성하게 되면 실행시 argument 가 필요한 경우가 있다.
spark-class 에서는 -arg 옵션을 통해서 전달했는데, spark-submit 에서는 어떻게 할 수 있을까?
Spark 문서(위 URL 참고) 에 보면 아래와 같이 설명하고 있다.
./bin/spark-submit \
--class <main-class>
--master <master-url> \
--deploy-mode <deploy-mode> \
--conf <key>=<value> \
... # other options
<application-jar> \
[application-arguments]
[application-arguments]
즉, command 마지막 부분에 argument 들을 나열하면 순서대로 main함수에 args 배열을 통해 전달된다.
추가적으로 각 옵션에 대해서 아래와 같이 설명하고 있다.
--class : The entry point for your application (e.g.org.apache.spark.examples.SparkPi )
--deploy-mode : Whether to deploy your driver on the worker nodes (cluster ) or locally as an external client (client ) (default:client )*
--conf : Arbitrary Spark configuration property in key=value format. For values that contain spaces wrap ¡°key=value¡± in quotes (as shown).
application-jar : Path to a bundled jar including your application and all dependencies. The URL must be globally visible inside of your cluster, for instance, anhdfs:// path or afile:// path that is present on all nodes.
application-arguments : Arguments passed to the main method of your main class, if any
|
참고 yarn 환경에서 --master 의 값은 yarn-cluster 또는 yarn-client 가 될 수 있다.
'BigData > Spark' 카테고리의 다른 글
Spark on YARN : Where have all the memory gone? (0) | 2015.07.18 |
---|---|
RDD persist() or cache() 시 주의사항 (0) | 2015.07.17 |
Learning Spark Chapter. 5 Loading & Saving Data (0) | 2015.07.17 |
Spark Memory Config on Apache YARN (0) | 2015.07.15 |
Learning Spark Chapter. 4 Key/Value Pairs 사용하기 (0) | 2015.07.03 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- jenkins
- Learning Spark
- linux
- 책요약
- bigdata
- mysql
- db
- 데이터 리터러시
- mongo
- jackson
- 태그를 입력해 주세요.
- Git
- java
- mongodb
- exception
- spring
- Django
- PYTHON
- spark
- 확률분포
- json
- flume
- Oracle
- jenkins2.0
- Apache Spark
- HADOOP
- 데이터과학자
- Hdfs
- 알고리즘
- Sqoop
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함