0

我正在学习如何使用 Elasticsearch,并且遇到了我的 create_index 不断失败的问题。它似乎在试运行时可以正常工作,但在实际运行中却失败了。我不确定我做错了什么,我检查了谷歌,但其他人似乎没有类似的问题。谢谢你的帮助。

这是我的 ACTION.YML:

actions:
  1:
    action: create_index
    description: "create the new index"
    options:
      name: creating_some_metrics.v1
      extra_settings:
        number_of_replicas: 4
        number_of_shards: 4
        refresh_interval: 1s
        mappings:
          parquet-metrics:
            properties:
              lists:
                properties:
                  success_date_history:
                    type: date
                  process_time_history:
                    type: date
                  stat_delta_seconds_history:
                    type: integer
                  options:
                    type: text
              '@timestamp':
                type: date
              id_schema:
                type: integer
              bucket:
                type: keyword
                fields:
                  text:
                    type: text
              error_code:
                type: keyword
              error_reason:
                type: text
                fields:
                  keyword:
                    type: keyword
                    ignore_above: 256
              error_trace:
                type: text
                fields:
                  keyword:
                    type: keyword
                    ignore_above: 256
              success_date:
                type: date
              object_key:
                type: text
                fields:
                  keyword:
                    type: keyword
                    ignore_above: 256
              object_path:
                type: text
                fields:
                  keyword:
                    type: keyword
                    ignore_above: 256
              partition_time:
                type: date
              partition_time_str:
                type: text
              process_time:
                type: date
              stat_delta_seconds:
                type: integer
              stat_file_count:
                type: integer
              stat_row_count:
                type: long
              stat_total_size:
                type: long
              stat_type:
                type: keyword
              status:
                type: keyword
              tag_id:
                type: text
                fields:
                  keyword:
                    type: keyword
                    ignore_above: 256

当我执行时,curator --config CONFIG.YML --dry-run ACTION.YML我得到:

2021-08-25 14:09:06,083 INFO                 curator.cli                    run:225  Action ID: 1, "create_index" completed.
2021-08-25 14:09:06,083 INFO                 curator.cli                    run:226  Job completed.

当我执行时,curator --config CONFIG.YML ACTION.YML我遇到了这个问题:

Failed to complete action: create_index.  <class 'curator.exceptions.FailedExecution'>: Exception encountered.
Exception: TransportError(500, '{"status:":"INTERNAL_SERVER_ERROR","message":"Internal server error"})

我在这里做错了什么?

4

1 回答 1

0

由于 Elasticsearch 没有用于索引创建的预演概念,因此无法使用此特定操作进行真正的预演。Curator 在这里所能做的就是验证 YAML 格式(而不是 API 调用本身)以及它是否可以连接到 Elasticsearch。这里的--dry-run标志实际上只执行无操作,因此不会引起问题。

您从 Elasticsearch 收到 500 错误,这意味着 Elasticsearch 服务器的上游正在发生某些事情。您可以通过直接查看 Elasticsearch 日志来查看更多信息,和/或设置:

logging:
  loglevel: DEBUG
  blacklist: []

在你的CONFIG.YML文件中。这将取消隐藏完整的 Elasticsearch 服务器响应,这些响应通常非常冗长。

于 2021-08-26T14:36:58.210 回答