首页 > 解决方案 > localstack 中的 ElasticSearch 是否支持数据流?

问题描述

我正在使用 ElasticSearch 最新版本运行 localstack,该版本7.7.0当前和创建数据流时出现错误。

 "error" : "Incorrect HTTP method for uri [/_index_template/my-datastream?pretty] and method [PUT], allowed: [POST]",

这是卷曲(映射被替换为点以保持简单):

curl -X PUT "localhost:4571/_index_template/my-datastream?pretty" -H 'Content-Type: application/json' -d'
{
  "index_patterns": [
    "audit-datastream*"
  ],
  "template": {
    "settings": {
      "index": {
        "lifecycle": {
          "name": "my-policy"
        },
        "number_of_shards": "3",
        "number_of_replicas": "1"
      }
    },
    "mappings": {
      "dynamic_templates": [
        {
         .....
        }
      ]
    }
  },
  "priority": 500,
  "version": 1,
  "data_stream": {}
}
'

标签: elasticsearchlocalstack

解决方案


在 7.9 中添加了数据流 - https://www.elastic.co/guide/en/elasticsearch/reference/7.9/data-streams.html

ps - 它是 Elasticsearch,而不是 ElasticSearch ;)


推荐阅读