2017-12-18 494 views
2

我在HA模式下有一個獨立的spark羣集(2個主控),並且有幾個工作人員在那裏註冊。忽略獨立羣集中通過REST作業提交進行的spark.master配置忽略

我通過REST接口提交的火花與工作細節之後,

{ 
    "sparkProperties": { 
     "spark.app.name": "TeraGen3", 
     "spark.default.parallelism": "40", 
     "spark.executor.memory": "512m", 
     "spark.driver.memory": "512m", 
     "spark.task.maxFailures": "3", 
     "spark.jars": "file:///tmp//test//spark-terasort-1.1-SNAPSHOT-jar-with-dependencies.jar", 
     "spark.eventLog.enabled": "false", 
     "spark.submit.deployMode": "cluster", 
     "spark.driver.supervise": "true", 
     "spark.master": "spark://spark-hn0:7077,spark-hn1:7077" 
    }, 
    "mainClass": "com.github.ehiggs.spark.terasort.TeraGen", 
    "environmentVariables": { 
     "SPARK_ENV_LOADED": "1" 
    }, 
    "action": "CreateSubmissionRequest", 
    "appArgs": ["4g", "file:///tmp/data/teradata4g/"], 
    "appResource": "file:///tmp//test//spark-terasort-1.1-SNAPSHOT-jar-with-dependencies.jar", 
    "clientSparkVersion": "2.1.1" 
} 

這個請求是通過REST接口(http://spark-hn1:6066/v1/submissions/create)提交到活動星火法師。

當驅動程序啓動時,將-Dspark.master設置爲「spark:// spark-hn1:7077」而不是在sparkProperties中傳遞的值,即spark:// spark-hn0:7077,spark -hn1:7077" 。從工作節點

日誌,其中驅動程序正在運行

17/12/18 13:29:49 INFO worker.DriverRunner: Launch Command: "/usr/lib/jvm/java-8-openjdk-amd64/bin/java" "-Dhdp.version=2.6.99.200-0" "-cp" "/usr/hdp/current/spark2-client/conf/:/usr/hdp/current/spark2-client/jars/*:/etc/hadoop/conf/" "-Xmx512M" "-Dspark.driver.memory=51 
2m" "-Dspark.master=spark://spark-hn1:7077" "-Dspark.executor.memory=512m" "-Dspark.submit.deployMode=cluster" "-Dspark.app.name=TeraGen3" "-Dspark.default.parallelism=40" "-Dspark.jars=file:///tmp//test//spark-terasort-1.1-SNAPSHOT-jar-with-dependencies.jar" "-Dspark.ta 
sk.maxFailures=3" "-Dspark.driver.supervise=true" "-Dspark.eventLog.enabled=false" "org.apache.spark.deploy.worker.DriverWrapper" "spark://[email protected]:40803" "/var/spark/work/driver-20171218132949-0001/spark-terasort-1.1-SNAPSHOT-jar-with-dependencies.jar" "com.git 
hub.ehiggs.spark.terasort.TeraGen" "4g" "file:///tmp/data/teradata4g/" 

這是造成問題,我當活動的主任務執行和其他主成爲活躍在下降。由於司機只知道一個主人(舊人),因此無法達到新主人並繼續執行工作(因爲spark.driver.supervise = true)

傳遞多個主要網址的正確方法是什麼Spark REST接口。

回答

0

看起來像這是RestServer實現中的一個錯誤,其中spark.master被替換。 https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/rest/StandaloneRestServer.scala#L147

我們仍然可以同時通過REST接口提交作業如下

"sparkProperties": { 
     "spark.app.name": "TeraGen3", 
     ... 
     "spark.driver.extraJavaOptions": "-Dspark.master=spark://spark-hn0:7077,spark-hn1:7077" 
    } 

這爲我工作在spark.driver.extraJavaOptions設置spark.master解決此。