spark-submit 이나 spark-shell 에서 클러스터 매니저를 선택하기 위해 --master option 을 선택한다.
local 이나 yarn 을 선택할 수 있는데, 이 옵션에 대해 더 자세히 알아보자.
Master URLs
The master URL passed to Spark can be in one of the following formats:
Master URLMeaning
local | Run Spark locally with one worker thread (i.e. no parallelism at all). |
local[K] | Run Spark locally with K worker threads (ideally, set this to the number of cores on your machine). |
local[K,F] | Run Spark locally with K worker threads and F maxFailures (see spark.task.maxFailures for an explanation of this variable) |
local[*] | Run Spark locally with as many worker threads as logical cores on your machine. |
local[*,F] | Run Spark locally with as many worker threads as logical cores on your machine and F maxFailures. |
spark://HOST:PORT | Connect to the given Spark standalone cluster master. The port must be whichever one your master is configured to use, which is 7077 by default. |
spark://HOST1:PORT1,HOST2:PORT2 | Connect to the given Spark standalone cluster with standby masters with Zookeeper. The list must have all the master hosts in the high availability cluster set up with Zookeeper. The port must be whichever each master is configured to use, which is 7077 by default. |
mesos://HOST:PORT | Connect to the given Mesos cluster. The port must be whichever one your is configured to use, which is 5050 by default. Or, for a Mesos cluster using ZooKeeper, use mesos://zk://.... To submit with --deploy-mode cluster, the HOST:PORT should be configured to connect to the MesosClusterDispatcher. |
yarn | Connect to a YARN cluster in client or cluster mode depending on the value of --deploy-mode. The cluster location will be found based on the HADOOP_CONF_DIR or YARN_CONF_DIR variable. |
k8s://HOST:PORT | Connect to a Kubernetes cluster in cluster mode. Client mode is currently unsupported and will be supported in future releases. The HOST and PORT refer to the Kubernetes API Server. It connects using TLS by default. In order to force it to use an unsecured connection, you can use k8s://http://HOST:PORT. |
출처
http://spark.apache.org/docs/latest/submitting-applications.html#master-urls
'Spark' 카테고리의 다른 글
[Spark] mongo-spark connector 로 aggregation 쿼리 보내는 예제 코드 (0) | 2019.11.06 |
---|---|
[Spark] Resource 제한하는 방법 (0) | 2019.11.05 |
[Spark] WebUI 의 duration 과 task time 이 왜 다른가? (0) | 2019.11.01 |
[Spark] Log Level 바꾸는 법 (1) | 2019.10.22 |
[Spark] spark-shell, spark-submit 명령어 사용법 (0) | 2019.10.16 |