dcos chronos spark向mesos master提交命令失败,原因是未经授权

kiz8lqtg  于 2021-06-26  发布在  Mesos
关注(0)|答案(0)|浏览(242)

我们正在使用restapi提交spark作业,以在dcos集群中触发主/集群管理器
下面的工作做得很好
rest端点=>服务/spark/v1/submissions/create

{
"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 token=${token},
但是当chronos执行这个命令时,它最终得到的响应表明这个请求是未经授权的。是否有一种方法可以将令牌转发到命令。
或者在具有授权令牌设置的dcos中,与集群管理器通信的chronos命令如何提供令牌。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题