I see packages.elastic.co/elasticsearch/5.3.0, but Curator is in a different path. Did you follow these instructions to add the Curator repository properly?
Neither can I. I just spun up a clean Ubuntu 16.04 VM:
Locale fix (for my VM). You may or may not need to do this if a UTF-8 charset is your default locale.
root@ubuntu1604-test:~$ locale-gen "en_US.UTF-8"
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
root@ubuntu1604-test:~$ dpkg-reconfigure locales
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
Now, the install:
root@ubuntu1604-test:~$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
OK
root@ubuntu1604-test:~$ echo "deb http://packages.elastic.co/curator/5/debian stable main" > /etc/apt/sources.list.d/curator.list
root@ubuntu1604-test:~$ apt update && apt install elasticsearch-curator
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://packages.elastic.co/curator/5/debian stable InRelease [1452 B]
Get:3 http://packages.elastic.co/curator/5/debian stable/main amd64 Packages [513 B]
... lots of other repos updated ...
Get:28 http://archive.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1232 B]
Fetched 16.4 MB in 4s (3384 kB/s)
Reading package lists... Done
Building dependency tree... Done
156 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
elasticsearch-curator
0 upgraded, 1 newly installed, 0 to remove and 156 not upgraded.
Need to get 11.4 MB of archives.
After this operation, 28.6 MB of additional disk space will be used.
Get:1 http://packages.elastic.co/curator/5/debian stable/main amd64 elasticsearch-curator amd64 5.0.4 [11.4 MB]
Fetched 11.4 MB in 1s (9597 kB/s)
Selecting previously unselected package elasticsearch-curator.
(Reading database ... 16228 files and directories currently installed.)
Preparing to unpack .../elasticsearch-curator_5.0.4_amd64.deb ...
Unpacking elasticsearch-curator (5.0.4) ...
Setting up elasticsearch-curator (5.0.4) ...
root@ubuntu1604-test:~$ export LC_ALL=en_US.utf8
root@ubuntu1604-test:~$ curator --version
curator, version 5.0.4
What's in your repository definition? Is it "deb http://packages.elastic.co/curator/5/debian stable main"?
Thanks. I was able to install curator. The problem was there were few other .list files present under sources.list.d. So it got fixed after deleting the other ones except curator.list.
First one is how do i define multiple filters to delete various indices in a single yml file ?
actions:
1:
action: delete_indices
description: >-
Delete indices older than 10 days (based on index name), for logstash-
prefixed indices. Ignore the error if the filter does not result in an
actionable list of indices (ignore_empty_list) and exit cleanly.
options:
ignore_empty_list: True
disable_action: False
filters:
- filtertype: pattern
kind: prefix
value: nginx-access-
- filtertype: pattern
kind: prefix
value: nginx-error-
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 10
I tried doing it like above but it did not work.
Second question is how do i setup cron for the action ? I tried invoking the below command but it did not work
curator --host localhost delete indices --older-than 60 --time-unit days --timestring '%Y.%m.%d'
The second question indicates you read some blog somewhere and are getting outdated configuration information. Since v4.0, Curator switched to a YAML-based configuration. Curator 4.2 restored some of that older syntax in the form of singleton command line syntax, using curator_cli, rather than just curator.
Please check the documentation before you blindly accept instructions from an outdated blog. Check to see that the instructions are for the appropriate version, and perhaps verify that it is the same as the current documentation.
Thanks a lot @theuntergeek . There are a lot of outdated documentations which is the reason for confusion from my side. Also for configuring cron for delete indices , I have followed https://github.com/elastic/curator/issues/655 and added it in crontab. Is this the right way or is there any other yml based way cron can be configured ?
This will run at 1:01am, and connect via the client configuration found in curator.yml and run the actions found in action.yml. Issue 655 addresses crontab issues for older versions of Curator, before v4.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.