0
我正試圖用集羣中隱藏的REST API觸發點火作業。我能夠觸發Spark工作,但它會一直執行,除非我明確地殺死它。來自REST的觸發點火作業無休止地執行作業
我的要求如下所示
curl -X POST http://sparkmaster:6066/v1/submissions/create --header "Content-Type:application/json;charset=UTF-8" --data '{
"action" : "CreateSubmissionRequest",
"appArgs" : ["10"],
"appResource" : "file:/path/to/myapp.jar",
"clientSparkVersion" : "1.6.1",
"environmentVariables" : {
"SPARK_ENV_LOADED" : "1"
},
"mainClass" : "com.brevitaz.app.Main",
"sparkProperties" : {
"spark.jars" : "file:/path/to/myapp.jar",
"spark.driver.supervise" : "true",
"spark.app.name" : "MySparkJob",
"spark.eventLog.enabled": "true",
"spark.submit.deployMode" : "client",
"spark.master" : "spark://sparkmaster:6066"
}
}'
響應
{
"action" : "CreateSubmissionResponse",
"message" : "Driver successfully submitted as driver-20170524105859-0022",
"serverSparkVersion" : "1.6.1",
"submissionId" : "driver-20170524105859-0022",
"success" : true
}
我期待提交作業,並只執行一次。有沒有辦法在火花上實現同樣的效果?
我打開其他方式來觸發火花工作。我需要的只是從基於Scala的Web應用程序中觸發執行Spark任務。