Elasticsearch Curator使用
生活随笔
收集整理的這篇文章主要介紹了
Elasticsearch Curator使用
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
介紹
Elasticsearch Curator通過以下方式幫助您策劃或管理您的Elasticsearch索引和快照:
- 從集群中獲取索引(或快照)的完整列表,作為可操作列表
- 迭代用戶定義的過濾器列表,根據(jù)需要逐步從此可操作列表中刪除索引(或快照)
- 對用戶定義的動作列表中的項(xiàng)目執(zhí)行各種操作(包括Create Index、Delete Indices、Reindex、Snapshot等)
使用
curator的命令行語法如下:
curator [--config CONFIG.YML] [--dry-run] ACTION_FILE.YML- CONFIG.YML:配置ES的基本信息
- ACTION_FILE.YML:具體的執(zhí)行腳本
- dry-run:curator將盡可能接近地模擬ACTION_FILE.YML中的動作,而不實(shí)際進(jìn)行任何更改
下面是具體的使用例子:
curator.yml:
deleteIndecies.yml:
actions:1:action: delete_indicesdescription: >-刪除超過120天的索引(基于索引名稱),用于nessus-前綴索引。如果過濾器沒有導(dǎo)致錯(cuò)誤,請忽略錯(cuò)誤可操作的索引列表(ignore_empty_list)并徹底退出.options:ignore_empty_list: Truedisable_action: Falsefilters:- filtertype: patternkind: prefixvalue: nessus-- filtertype: agesource: namedirection: oldertimestring: '%Y.%m.%d'unit: daysunit_count: 1202:action: delete_indicesdescription: >-刪除超過60天的索引(基于索引名稱),用于metricbeat-6.2.2-前綴索引。options:ignore_empty_list: Truedisable_action: Falsefilters:- filtertype: patternkind: prefixvalue: metricbeat-6.2.2-- filtertype: agesource: namedirection: oldertimestring: '%Y.%m.%d'unit: daysunit_count: 60最后執(zhí)行curator --config curator.yml --dry-run deleteIndecies.yml即可刪除nessus120天之前的索引運(yùn)行(實(shí)際使用時(shí)記得刪除–dry-run)
其它功能可以前往官網(wǎng)查看官方文檔或使用實(shí)例
總結(jié)
以上是生活随笔為你收集整理的Elasticsearch Curator使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【竞赛总结】CCF多人种人脸识别
- 下一篇: 10000字超全Redis面试题,再也不