![](/img/trans.png)
[英]How multiple executors are managed on the worker nodes with a Spark standalone cluster?
[英]How Can I submit multiple jobs in Spark Standalone cluster?
我有一台裝有Apache Spark的機器。 機器是64GB RAM 16 Cores
。
我在每個火花工作中的目標
1. Download a gz file from a remote server
2. Extract gz to get csv file (1GB max)
3. Process csv file in spark and save some stats.
目前,我通過執行以下操作為收到的每個文件提交一份工作
./spark-submit --class ClassName --executor-cores 14 --num-executors 3 --driver-memory 4g --executor-memory 4g jar_path
然后等待該作業完成,然后為新文件啟動新作業。
現在,我想通過並行運行多個作業來利用64GB RAM。
我可以為每個作業分配4g RAM,並希望在有足夠的作業正在運行時將作業排隊。
我該如何實現?
您應該從不同的線程提交多個作業:
https://spark.apache.org/docs/latest/job-scheduling.html#scheduling-within-an-application
並配置池屬性(將scheduleMode設置為FAIR):
https://spark.apache.org/docs/latest/job-scheduling.html#configuring-pool-properties
從Spark Doc:
https://spark.apache.org/docs/latest/spark-standalone.html#resource-scheduling :
獨立群集模式當前僅支持跨應用程序的簡單FIFO調度程序。 但是,要允許多個並發用戶,您可以控制每個應用程序將使用的最大資源數量。 默認情況下,它將獲取群集中的所有內核,這僅在您一次只運行一個應用程序時才有意義。 您可以通過設置spark.cores.max來限制內核數。
默認情況下,它將所有資源用於一個作業。我們需要定義資源,以便它們也有空間運行其他作業。以下是可用於提交Spark作業的命令。
bin/spark-submit --class classname --master spark://hjvm1:6066 --deploy-mode cluster --driver-memory 500M --conf spark.executor.memory=1g --conf spark.cores.max=1 /data/test.jar
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.