Search code examples
elasticsearchjaeger

How to remove old indices of Jaeger in Elasticsearch?


I use Jaeger with Elasticsearch and I want to remove old indices. I tried jaeger-es-index-cleaner, see Remove old data:

Remove old data

The historical data can be removed with the jaeger-es-index-cleaner that is also used for daily indices.

docker run -it --rm --net=host -e ROLLOVER=true jaegertracing/jaeger-es-index-cleaner:latest 14 http://localhost:9200 # <1>

<1> Remove indices older than 14 days.

Log

I tried to delete all indices older than 2 days, but no indice was deleted:

$ docker run -it --rm --net=host -e ROLLOVER=true jaegertracing/jaeger-es-index-cleaner:latest 2 http://localhost:9200
No indices to delete

Indices

If I list all indices with http://localhost:9200/_cat/indices, I still see old indices:

yellow open jaeger-service-2021-04-09      vhdjlv5BR9yHhFgqmemiPA 5 1      70  1  38.6kb  38.6kb
yellow open jaeger-span-2021-04-09         Z-o78_oiStuiEdDJO79_6Q 5 1   49091  0     2mb     2mb
yellow open jaeger-dependencies-2021-04-13 tgCw5vK1SeG5oa6m-4osBQ 1 1       1  0     9kb     9kb
yellow open jaeger-service-2021-04-12      zi2ifth0RVKxyYNlfqe4kA 5 1      87  1  66.4kb  66.4kb
yellow open jaeger-span-2021-04-12         DeDPz2kNQKWiTI5v5rgKTg 5 1 5780283  0 188.5mb 188.5mb
yellow open jaeger-service-2021-04-13      vztAwPDPS2-okqywSGOIxw 5 1      81 22  70.7kb  70.7kb
yellow open jaeger-span-2021-04-13         SMJA7pJrQ6qZYsTXnwQVsw 5 1 4102841  0   141mb   141mb

Question

How to delete old indices of Jaeger from Elasticsearch?


Solution

  • Removing -e ROLLOVER=true did it:

    $ docker run -it --rm --net=host jaegertracing/jaeger-es-index-cleaner:latest 2 http://localhost:9200