LoginSignup
191
180

More than 5 years have passed since last update.

curator で Kibana 用の elasticsearch のインデックスを定期的に削除する

Last updated at Posted at 2014-04-24

2015/3/15 curator v3.0   v2.0 

Kibana 


elasticsearch CPU




Kibana 

 Index 便 curator 


Python  pip 
$ sudo apt-get install python
$ cd /tmp
$ wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ sudo python get-pip.py

インストール

pip でインストールできます。curator --version と打って、バージョンが表示されればインストール完了です。

$ sudo pip install elasticsearch-curator
$ curator --version
curator, version 3.0.0

インデックスの削除

curator では様々なインデックス削除の方法を提供していますが、基本的には、最新の n日分のインデックスを残し、古いものは削除、という方法で十分です。

例えば、最新の30日分の Kibanaの logstash という名前のインデックスだけ残しておきたい場合は、

$ curator --host my-elasticsearch delete indices --prefix logstash --older-than 30 --time-unit days --timestring %Y.%m.%d

my-elasticsearch  elasticsearch IP

12

便 Tips


 Close Close  Open 

30 Close 60
$ curator --host my-elasticsearch close indices --prefix logstash --older-than 30 --time-unit days --timestring %Y.%m.%d
$ curator --host my-elasticsearch delete indices --prefix logstash --older-than 60 --time-unit days --timestring %Y.%m.%d

ついでに、パフォーマンス関連のオプションを指定しましょう。

$ curator --host my-elasticsearch bloom indices --prefix logstash --older-than 2 --time-unit days --timestring %Y.%m.%d

2 bloom filter bloom filter  Codec Kibana  Cold Index bloom filter 使
bloom filter  elasticsearch 0.90.9 使


Daily  cron  Jenkins Job elasticsearch  AM 0:00 AM 2:00


v3.0 CLI使


Elasticsearch Curator CLI


2
191
180
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

191
180