dcos 1.7身份验证失败,令牌无效原因:数据不足

g0czyy6m  于 2021-06-26  发布在  Mesos
关注(0)|答案(1)|浏览(358)

我们使用云形成模板在aws中构建了DCOS1.7集群,具体步骤如下:“启动dc/os”https://dcos.io/docs/1.7/administration/installing/cloud/aws/
我尝试使用curl运行以下查询

curl --header " Authorization: token=xxxxx" https://{dcos-elb}/service/chronos/scheduler/jobs

但是我得到了

<html>
<head>
<title>Unauthorized</title>
<noscript><meta http-equiv="refresh" content="5; url=/#/login"></noscript>
<script>
  (function () {
    var location = window.location;
    location.href = "/#/login?redirect=" + encodeURIComponent(location.href);
  }())
</script>
</head>
<body>
   <h1>Unauthorized</h1>
</body>
</html>

我按照这些指示得到了令牌https://dcos.io/docs/1.7/administration/security/managing-authentication/#log-在cli中
i、 e.在浏览器中粘贴此url:https:///登录?重定向\u uri=urn:ietf:工作组:oauth:2.0:oob,使用google creds登录,然后复制令牌
adminrouter登录主节点时有以下行

[notice] 31915#0: *8026 [lua] auth.lua:119: validate_jwt_or_exit(): Invalid token. Reason: not enough data, client: xx.xx.xx.xx, server: dcos.*, request: "GET /service/chronos/scheduler/jobs HTTP/1.1", host: "xxxxx"

如何解决这个问题?。我必须在curl查询中包含任何额外的负载吗?
如有任何建议,将不胜感激。谢谢

ef1yzkbh

ef1yzkbh1#

首先, dcos config show 并检查变量值 core.dcos_url ,确保您正在点击“http”而不是“https”。
要进行更改,请遵循以下步骤,
1:) dcos config unset core.dcos_url 2:) dcos config set core.dcos_url <CLuster_URL_Only_HTTP> 3:)你终于可以做到了, dcos auth login 4:)步骤(3)将返回url,您必须将其粘贴到浏览器中,然后获取令牌并将其粘贴到cli上,而cli正在等待令牌。

相关问题