【问题标题】:unable to retrieve the elastic search reindexing task details getting error "malformed task id"无法检索弹性搜索重新索引任务详细信息,出现错误“格式错误的任务 ID”
【发布时间】:2021-04-29 15:42:50
【问题描述】:

我已使用该命令启动大型索引的重新索引。

curl -XPOST https://<SERVER_HOST_NAME>/_reindex  -H 'Content-Type: application/json' -d '
{
  "source": {
    "index": "source_index"
  },
  "dest": {
    "index": "destination_index"
  }
}'

问题是我无法在运行时知道索引操作的状态。

我正在使用任务 API 来获取任务列表。

https://<SERVER_HOST_NAME>/_tasks

我可以看到重新索引任务。

"<nodename>:8793524": {
                    "node": "<nodename>",
                    "id": 8793524,
                    "type": "transport",
                    "action": "indices:data/write/reindex",
                    "start_time_in_millis": 1619678127505,
                    "running_time_in_nanos": 6776632132,
                    "cancellable": true,
                    "headers": {}
                }

但是当我使用此任务 ID 从邮递员(端点:https:///_tasks /8793524)获取任务状态时,它给了我一个错误。

{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "malformed task id 8793524"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "malformed task id 8793524"
    },
    "status": 400
}

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    您需要在任务 ID 之前包含节点名称,如下所示:

    https://<SERVER_HOST_NAME>/_tasks/<nodename>:8793524
    

    【讨论】:

    • 非常感谢,它成功了,我可以查看状态了。
    • 我认为问题在于响应 /_task api 的属性名称。它被命名为id,但实际上它是一个任务号。
    • 我认为应该是GET /_tasks/node_name:taskId而不是示例中的GET /_tasks/taskId:1elastic.co/guide/en/elasticsearch/reference/5.6/…
    猜你喜欢
    • 1970-01-01
    • 2017-12-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-04
    相关资源
    最近更新 更多