Elastic Search 6以上版本推出 ILM,用于管理Index的生命周期,但AWS上的ES是基于OSS版本的ES,所以自己开发了ISM来代替ILM。项目是从logstash往ES写入数据,但碰到无法在Logstash开启ILM_enabled=true的问题,这样就无法直接让logstash应用ISM。通过查询资料,最后发现AWS的 ES OSS关闭了ilm。而是直接在ism里去做所有的设置,Logstash指定index alias写入数据即可。

第一步:编写 State management policies

{
"policy_id": "Test_ILM_policy",
"description": "Demonstrate a hot-warm-cold-delete workflow.",
"last_updated_time": 1640873761350,
"schema_version": 1,
"error_notification": null,
"default_state": "hot",
"states": [
{
"name": "hot",
"actions": [
{
"rollover": {
"min_doc_count": 200,
"min_index_age": "2h"
}
},
{
"read_write": {}
}
],
"transitions": [
{
"state_name": "warm",
"conditions": {
"min_index_age": "3h"
}
}
]
},
{
"name": "warm",
"actions": [
{
"timeout": "24h",
"retry": {
"count": 5,
"backoff": "exponential",
"delay": "15m"
},
"warm_migration": {}
}
],
"transitions": [
{
"state_name": "cold",
"conditions": {
"min_index_age": "4h"
}
}
]
},
{
"name": "cold",
"actions": [
{
"cold_migration": {
"start_time": null,
"end_time": null,
"timestamp_field": "@timestamp",
"ignore": "none"
}
}
],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "30d"
}
}
]
},
{
"name": "delete",
"actions": [
{
"cold_delete": {}
}
],
"transitions": []
}
],
"ism_template": [
{
"index_patterns": [
"test-ilm-index-*"
],
"priority": 100,
"last_updated_time": 1640094369756
}
]
}

第二步:编写index template关联 policy

PUT _index_template/test_ilm_index_template
{
"index_patterns": ["test-ilm-index-*"],
"template": {
"settings": {
"number_of_shards": 2,
"number_of_replicas": 0,
"index": {
"opendistro": {
"index_state_management": {
"rollover_alias": "test-ilm-indexs"
}
}
}
},
"mappings": {
"properties": {
"@timestamp": {
"format": "strict_date_optional_time||epoch_millis",
"type": "date"
}
}
}
}
}

第三步:创建index,关联index template rollover alias

PUT test-ilm-index-000001
{ "aliases": {
"test-ilm-indexs": {
"is_write_index": true
}
}
}

第四步:Logstash指定写入的index=index template rollover alias

hosts => ["]
user => ""
password => ""
index => "test-ilm-indexs"
ssl => true

官方文档:https://opensearch.org/docs/latest/im-plugin/ism/policies/#sample-policy-with-ism-template-for-auto-rollover

AWS ES ISM学习应用笔记的更多相关文章

  1. 每天成长一点---WEB前端学习入门笔记

    WEB前端学习入门笔记 从今天开始,本人就要学习WEB前端了. 经过老师的建议,说到他每天都会记录下来新的知识点,每天都是在围绕着这些问题来度过,很有必要每天抽出半个小时来写一个知识总结,及时对一天工 ...

  2. DSP28377S - ADC学习编程笔记

    DSP28377S -  ADC学习编程笔记 彭会锋 2016-08-04  20:19:52 1 ADC类型导致的配置区别 F28377S的ADC类型是Type 4类型,我的理解是不同类型的ADC采 ...

  3. 学习ReactNative笔记整理一___JavaScript基础

    学习ReactNative笔记整理一___JavaScript基础 ★★★笔记时间- 2017-1-9 ★★★ 前言: 现在跨平台是一个趋势,这样可以减少开发和维护的成本.第一次看是看的ReactNa ...

  4. 深度学习word2vec笔记之算法篇

    深度学习word2vec笔记之算法篇 声明:  本文转自推酷中的一篇博文http://www.tuicool.com/articles/fmuyamf,若有错误望海涵 前言 在看word2vec的资料 ...

  5. 强化学习读书笔记 - 02 - 多臂老O虎O机问题

    # 强化学习读书笔记 - 02 - 多臂老O虎O机问题 学习笔记: [Reinforcement Learning: An Introduction, Richard S. Sutton and An ...

  6. 强化学习读书笔记 - 05 - 蒙特卡洛方法(Monte Carlo Methods)

    强化学习读书笔记 - 05 - 蒙特卡洛方法(Monte Carlo Methods) 学习笔记: Reinforcement Learning: An Introduction, Richard S ...

  7. 强化学习读书笔记 - 06~07 - 时序差分学习(Temporal-Difference Learning)

    强化学习读书笔记 - 06~07 - 时序差分学习(Temporal-Difference Learning) 学习笔记: Reinforcement Learning: An Introductio ...

  8. (转)深度学习word2vec笔记之基础篇

    深度学习word2vec笔记之基础篇 声明: 1)该博文是多位博主以及多位文档资料的主人所无私奉献的论文资料整理的.具体引用的资料请看参考文献.具体的版本声明也参考原文献 2)本文仅供学术交流,非商用 ...

  9. 深度学习word2vec笔记之基础篇

    作者为falao_beiliu. 作者:杨超链接:http://www.zhihu.com/question/21661274/answer/19331979来源:知乎著作权归作者所有.商业转载请联系 ...

  10. Python学习基础笔记(全)

    换博客了,还是csdn好一些. Python学习基础笔记 1.Python学习-linux下Python3的安装 2.Python学习-数据类型.运算符.条件语句 3.Python学习-循环语句 4. ...

随机推荐

  1. 物色到的 c# 模拟 http post get 请求 做下笔记

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.N ...

  2. Hive-分区取TOP N问题

    问题背景 设想你对用户在不同品类上的行为打分聚合后得到这样一个表 user_cate_score uid cate score 1 1 0.3 2 2 0.5 8 3 0.9 现在,你想将每个品类的T ...

  3. vue-element-admin iframes 组件 保留 iframe 操作状态

    由于没有时间去维护这个功能,这个仓库我暂停了,当前博客内容和代码只作为实现思路参考 代码贴前面,gitee地址:https://gitee.com/chkhk/vue-element-admin 可以 ...

  4. 多个request接口的功能优化处理速度

    一.原始代码功能如下,包含两个request接口的调用,耗时情况约4秒 import datetime import time import requests start_time = datetim ...

  5. JS leetcode 最长公共前缀 题解分析

    壹 ❀ 引 今天做的又是一道让我沮丧的题,思路有,但是代码逻辑最后还是没能正确理出来,题名为最长公共前缀,题目如下: 编写一个函数来查找字符串数组中的最长公共前缀. 如果不存在公共前缀,返回空字符串 ...

  6. NC25045 [USACO 2007 Jan S]Balanced Lineup

    题目链接 题目 题目描述 For the daily milking, Farmer John's N cows (1 ≤ N ≤ 100,000) always line up in the sam ...

  7. ARP(Address Resolution Protocol) Packet

    Address Resolution Protocol The Address Resolution Protocol (ARP) is a communication protocol used f ...

  8. 解密prompt系列24. RLHF新方案之训练策略:SLiC-HF & DPO & RRHF & RSO

    去年我们梳理过OpenAI,Anthropic和DeepMind出品的经典RLHF论文.今年我们会针对经典RLHF算法存在的不稳定,成本高,效率低等问题讨论一些新的方案.不熟悉RLHF的同学建议先看这 ...

  9. 开源:Taurus.DistributedLock 分布式锁框架,支持 .Net 和 .Net Core 双系列版本

    前言: 在经过漫长的技术沉淀,终于又为 .Net 及 .Net Core 的微服务系列框架贡献当中的一个重要组件. Taurus.DistributedLock is a distributed lo ...

  10. 2021-10-11 vue的第三方组件二次封装

    原理 v-bind="$attrs"继承所有属性和props. v-on="$listeners"继承所有的方法. <template> <d ...