首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ElasticSearch - query_shard_exception |找不到[timestamp]的映射,以便通过kibana开发工具对工作进行排序,但通过API出现400错误。

问ElasticSearch - query_shard_exception |找不到[timestamp]的映射,以便通过kibana开发工具对工作进行排序,但通过API出现400错误。
EN

Stack Overflow用户
提问于 2021-08-01 06:21:48
回答 1查看 172关注 0票数 0

在查询Elastic search时遇到了一个奇怪的问题,当通过Kibana开发工具运行时,查询给出了正确的响应,但通过Rest API命中时,给出了400错误,即找不到映射。以下是详细信息。通过Kibana dev工具查询:

获取diagnostics/_search?pretty=true&q=OTA4MjYxODM3NQ&size=6&sort=timestamp:desc

正在获取对上述查询的响应:

代码语言:javascript
复制
    {
      "took": 0,
      "timed_out": false,
      "_shards": {
        "total": 5,
        "successful": 5,
        "failed": 0
      },
      "hits": {
        "total": 22,
        "max_score": null,
        "hits": [
          {
    .......
    }
    ]
    }

但是当我通过Rest API进行同样的操作时,下面是这样的场景: API - http://IP:9200/diagnostics/_search?pretty=true&q=OTA4MjYxODM3NQ&size=6&sort=timestamp:desc

响应:

代码语言:javascript
复制
    {
        "error": {
            "root_cause": [
                {
                    "type": "query_shard_exception",
                    "reason": "No mapping found for [timestamp] in order to sort on",
                    "index_uuid": "JYOLtQ_URBGKnhxUWzD3dA",
                    "index": "diagnostics"
                }
            ],
            "type": "search_phase_execution_exception",
            "reason": "all shards failed",
            "phase": "query",
            "grouped": true,
            "failed_shards": [
                {
                    "shard": 0,
                    "index": "diagnostics",
                    "node": "kisW84q1SbKEz7KQiOtY7Q",
                    "reason": {
                        "type": "query_shard_exception",
                        "reason": "No mapping found for [timestamp] in order to sort on",
                        "index_uuid": "JYOLtQ_URBGKnhxUWzD3dA",
                        "index": "diagnostics"
                    }
                }
            ]
        },
        "status": 400
    }

请帮助我,因为我发现这非常奇怪,因为当我调用API时,通过代码,它是失败的,我被困在理解这个问题的根本原因。

获取诊断详细信息

代码语言:javascript
复制
http://IP(A):9200/diagnostics
{
    "diagnostics": {
        "aliases": {},
        "mappings": {},
        "settings": {
            "index": {
                "creation_date": "1613465495276",
                "number_of_shards": "5",
                "number_of_replicas": "0",
                "uuid": "JYOLtQ_URBGKnhxUWzD3dA",
                "version": {
                    "created": "5050199"
                },
                "provided_name": "diagnostics"
            }
        }
    }
}

通过运行在IP(A)上的Kibana开发工具:5601-

代码语言:javascript
复制
GET diagnostics
{
  "diagnostics": {
    "aliases": {},
    "mappings": {
      "results": {
        "properties": {
details are present here....
}
"number_of_shards": "5",
        "provided_name": "diagnostics",
        "creation_date": "1545374854111",
        "number_of_replicas": "0",
        "uuid": "CB7Vci8MTNiW2F85_S4z4Q",
        "version": {
          "created": "5050199"
        }
      }
    }
  }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-08-02 09:19:03

几乎可以肯定的是,您的Kibana指向另一个正在运行的Elasticsearch实例。

确保设置elasticsearch.hosts下的kibana.yml文件中的IP与IP(A)相同。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68607951

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档