Elasticsearch rollover API

Rollover API | Elasticsearch Guide [8.13] | Elastic

https://www.cnblogs.com/chong-zuo3322/p/13701411.html

PUT <my-index-{now/d}-000001>

PUT %3Cmy-index-%7Bnow%2Fd%7D-000001%3E

{

"aliases": {

"my-alias": {

"is_write_index": true

}

}

}

如果大家对于上面的字符串 "%3Clogs-%7Bnow%2Fd%7D-1%3E" 比较陌生的话,可以参考网站 URL Encode Online | URLEncoder。实际上它就是字符串 "<logs-{now/d}-1>" 的url编码形式。请注意上面的 is_write_index 必须设置为 true

The following request only rolls over the alias if the current write index meets one or more of the following conditions:

  • The index was created 7 or more days ago.
  • The index contains 1,000 or more documents.
  • The index's largest primary shard is 50GB or larger.

POST /log_alias/_rollover

{

"conditions": {

"max_age": "7d", 时间超过7天

"max_docs": "2", doc条数超过2条

"max_size": "5gb" 大小超过5G

}

}

{

"acknowledged": true,

"shards_acknowledged": true,

"old_index": "my-index-2099.05.06-000001",

"new_index": "my-index-2099.05.07-000002",

"rolled_over": true,

"dry_run": false,

"lazy": false,

"conditions": {

"[max_age: 7d]": false,

"[max_docs: 1000]": true,

"[max_primary_shard_size: 50gb]": false,

"[max_primary_shard_docs: 2000]": false

}

}

向别名中添加数据:

PUT log_alias/doc/1

{

"message": "a dummy log"

}

PUT log_alias/doc/2

{

"message": "a dummy log"

}

复制代码
GET _cat/indices/logs-2020.09.21*
相关推荐
ManageEngineITSM1 天前
技术的秩序:IT资产与配置管理的现代重构
大数据·运维·数据库·重构·工单系统
一周困⁸天.1 天前
Elasticsearch+Logstash+Filebeat+Kibana部署【7.1.1版本】
大数据·elk·elasticsearch·jenkins
档案宝档案管理1 天前
档案宝:企业合同档案管理的“安全保险箱”与“效率加速器”
大数据·数据库·人工智能·安全·档案·档案管理
数据与后端架构提升之路1 天前
Elasticsearch 与 Faiss 联合驱动自动驾驶场景检索:高效语义匹配 PB 级视频数据
elasticsearch·自动驾驶·faiss
workflower1 天前
FDD(Feature Driven Development)特征驱动开发
大数据·数据库·驱动开发·需求分析·个人开发
小雨的光1 天前
QuickEsView
spring boot·elasticsearch·es可视化
xiaobangsky1 天前
Elasticsearch安装使用
elasticsearch·jenkins
熙客1 天前
Elasticsearch:分布式搜索引擎数据库
分布式·elasticsearch·搜索引擎
YangYang9YangYan1 天前
高职新能源汽车技术专业职业发展指南
大数据·人工智能·数据分析·汽车
河南博为智能科技有限公司1 天前
RS485转以太网串口服务器-串口设备联网的理想选择
大数据·服务器·人工智能·单片机·嵌入式硬件·物联网