【问题标题】:Datastax Enterprise 5.0.1 Opscenter 6.0.1 returns 400 error when retrieving metrics by APIDatastax Enterprise 5.0.1 Opscenter 6.0.1 通过 API 检索指标时返回 400 错误
【发布时间】:2016-12-29 09:14:05
【问题描述】:

我正在使用 Opscenter 6.0.1 监控 DSE 5.0.1。 我正在测试 Opscenter API 以检索节点/集群指标,但我得到了 当我抛出如下查询时出现 400 个错误。

curl -vvv -H 'opscenter-session: xxxxxx' -G
'http://<opscenter>/<cluster>/metrics/<node>/data-load'

> GET /IDC/metrics/<node>/data-load HTTP/1.1
> User-Agent: curl/7.35.0
> Host: <opscenter>
> Accept: */*
> opscenter-session: xxxxxx
>
< HTTP/1.1 400 Bad Request
< Transfer-Encoding: chunked
< Date: Fri, 19 Aug 2016 20:45:36 GMT
* Server TwistedWeb/15.3.0 is not blacklisted
< Server: TwistedWeb/15.3.0
< Content-Type: application/json
< Cache-Control: max-age=0, no-cache, no-store, must-revalidate
<
* Connection #0 to host <opscenter> left intact
{"message": "unsupported operand type(s) for -: 'NoneType' and
'NoneType'", "type": "TypeError"}

我可以将相同的会话 ID、opscenter ip、节点 ip 用于不同的 API调用(用于检索配置的API),我得到了没有问题的响应,但没有任何运气 指标相关的调用。 错误消息似乎在抱怨“-”,但我不确定是什么 我要求的数据有问题..

我只是在尝试这里描述的一些调用,而不使用任何可选查询 参数:http://docs.datastax.com/en/opscenter/6.0/api/docs/metrics.html

我应该在哪里更改以检索指标?

谢谢, 葵

【问题讨论】:

    标签: datastax-enterprise opscenter


    【解决方案1】:

    这是 OpsCenter 6.0.1 中最近的一个已知错误(在 JIRA 内部跟踪为 OPSC-9727)。我们计划在 6.0.3 补丁版本中包含修复。

    解决方法是包含 startend 参数的值。正如您所指出的,这些参数应该是可选的,但将它们排除在外会导致此错误。您可以通过指定默认值 as documented here 来模仿默认行为,它们是:

    • end - 时间戳,以秒为单位,表示当前时间
    • start - 时间戳,以秒为单位,表示end 的前一天

    我们深表歉意,责任人已被毫不留情地质问。

    【讨论】:

    • 感谢 Scott 提供的信息。在我们升级之前,我会使用解决方法!
    • 嗨,斯科特,我尝试了您的解决方法,但仍然无法正常工作。 # curl -H 'opscenter-session: xxxx' -X GET http:////new-metrics -d "metrics=heap-used" -d "nodes=" -d ' start=1473186039' -d 'end=1473272439' -d 'function=average' -d 'step=120' {"message": "不支持的操作数类型 -: 'NoneType' 和 'NoneType'", "类型”:“类型错误”}
    • # date +%s 1473272439 我从这个命令结果中得到日期(以秒为单位)并从这个数字计算开始日期
    • 对不起@aoi - 这周我会尝试解决问题。你还发现这个问题吗?
    • 是的,仍然无法正常工作...感谢您的帮助,Scott。
    猜你喜欢
    • 2016-12-05
    • 1970-01-01
    • 2016-11-04
    • 2017-08-02
    • 1970-01-01
    • 2014-02-26
    • 2016-06-26
    • 1970-01-01
    • 2016-11-05
    相关资源
    最近更新 更多