前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >datastream操作步骤

datastream操作步骤

原创
作者头像
周银辉
修改2024-09-26 15:15:11
1230
修改2024-09-26 15:15:11
举报
文章被收录于专栏:ElasticSearch
代码语言:txt
复制
GET _ilm/policy/demo_1
PUT _ilm/policy/demo_1
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0",
        "actions": {
          "set_priority": {
            "priority": 100
          },
          "rollover": {
            "max_age": "3d",
            "max_docs": 3,
            "max_size": "2gb"
          }
        }
      },
      "warm": {
        "min_age": "1d",
        "actions": {
          "set_priority": {
            "priority": 50
          },
          "allocate": {
            "number_of_replicas": 0
          },
          "shrink": {
            "number_of_shards": 1
          },
          "forcemerge": {
            "max_num_segments": 1
          }
        }
      }
    }
  }
}

PUT _cluster/settings
{
    "transient": {
      "indices.lifecycle.poll_interval": "10s"
    }
}

PUT _index_template/template_demo
{
  "index_patterns": ["demo-*"],
   "priority": 200,
   "data_stream": { }, 
   "template": {
     "settings": {
       "number_of_replicas": 1,
       "number_of_shards": 3,
       "index.lifecycle.name":"demo_1"
     }
   }
}

PUT _ingest/pipeline/add-timestamp
{
  "processors": [
    {
      "set": {
        "field": "@timestamp",
        "value": "{{_ingest.timestamp}}"
      }
    }
  ]
}

PUT _data_stream/demo-ds
GET  demo-ds/_search

POST demo-ds/_doc?pipeline=add-timestamp
{
  "user":{
    "id":"zhouyinhui"
  },
  "message":"this is so coo"
}

GET demo-ds/_ilm/explain

GET demo-ds/_search

DELETE _data_stream/demo-ds

POST _index_template/_simulate_index/demo-ds


原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档