我们按照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,使用谷歌凭据登录,然后复制令牌
主节点中的 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 查询中包含任何额外的有效负载?
任何建议将不胜感激。谢谢