【问题标题】:DCOS 1.7 authentication failure with Invalid token. Reason: not enough dataDCOS 1.7 身份验证失败,令牌无效。原因:数据不够
【发布时间】:2016-05-19 04:22:05
【问题描述】:

我们按照此处https://dcos.io/docs/1.7/administration/installing/cloud/aws/的“启动dc/os”说明,使用云形成模板在aws中构建了dcos 1.7集群

我尝试使用 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-in-cli

即在浏览器中粘贴此网址:https:///login?redirect_uri=urn:ietf:wg: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 查询中包含任何额外的有效负载?

任何建议将不胜感激。谢谢

【问题讨论】:

    标签: mesos mesosphere dcos


    【解决方案1】:

    首先,dcos config show 并检查 core.dcos_url 的变量值,确保您点击“HTTP”并且NOT“HTTPS”。

    要进行更改,请按照以下步骤进行,

    1:) dcos config unset core.dcos_url

    2:) dcos config set core.dcos_url &lt;CLuster_URL_Only_HTTP&gt;

    3:) 终于可以了,dcos auth login

    4:) 步骤(3)将返回URL,您必须将其粘贴到浏览器中并获取Token并将其粘贴到Cli上,等待Token。

    【讨论】:

    • 嗨,我使用我的 mesos 主 IP 作为 dcos config set core.dcos_url http://10.198.161.42:5050,然后是 dcos auth login,但它给了我错误 Error while fetching [10.198.161.42:5050/exhibitor/]: HTTP 404: Not Found我>
    猜你喜欢
    • 1970-01-01
    • 2018-07-23
    • 2014-08-17
    • 2020-01-27
    • 2018-02-16
    • 2020-10-30
    • 1970-01-01
    • 2020-07-24
    • 2018-11-26
    相关资源
    最近更新 更多