我们正在使用其余的api进行火花作业提交,以激活dcos集群中的主/集群管理器
以下工作完美无缺
休息结束点=>服务/火花/ V1 /提交/创建
{
"action" : "CreateSubmissionRequest",
"appArgs" : [ "100" ],
"appResource" : "https://<s3 location>/spark-examples-1.5.1-hadoop2.4.0.jar",
"clientSparkVersion" : "1.6.1",
"environmentVariables" : {
"SPARK_ENV_LOADED" : "1",
"SPARK_JAVA_OPTS" : "-Dspark.mesos.coarse=true -Dspark.mesos.executor.docker.image=mesosphere/spark:1.0.0-1.6.1-2"
},
"mainClass" : "org.apache.spark.examples.SparkPi",
"sparkProperties" : {
"spark.jars" : "https://<s3 location>/spark-examples-1.5.1-hadoop2.4.0.jar",
"spark.app.name" : "SparkPi",
"spark.submit.deployMode" : "cluster",
"spark.master" : "mesos://<dcos mesos master>/service/spark/",
"spark.executor.cores" : "1",
"spark.executor.memory" : "2048m",
"spark.cores.max" : "2",
"spark.mesos.executor.docker.image" : "mesosphere/spark:1.0.0-1.6.1-2"
}
}
使用授权标头授权令牌= $ {token}
当我将它提交给chronos时 rest endpoint - / service / chronos / scheduler / iso8601
{
"schedule": "R10/2016-06-16T08:28:00Z/PT2H",
"name": "sparkjavachronos",
"container": {
"type": "DOCKER",
"image": "mesosphere/spark:1.0.0-1.6.1-2"
},
"cpus": "0.5",
"mem": "1024",
"command": "/opt/spark/dist/bin/spark-submit --class org.apache.spark.examples.SparkPi --master mesos://<dcos mesos-master>/service/spark/ --deploy-mode cluster --supervise --executor-memory 2g --total-executor-cores 1 https://<s3 location>/spark-examples-1.5.1-hadoop2.4.0.jar 100"
}
chronos作业提交可以使用Authorization标头Authorization token = $ {token},
但是当chronos执行命令时,它会以响应指示请求未经授权。有没有办法将令牌转发到命令。
或chronos命令与集群管理器的对话如何在具有授权令牌设置的dcos中提供令牌。