So I have two questions that I have not been able to find an answer for yet. First and most annoying, is I am unable to schedule Curator to on a daily basis. I have a cron job setup as follows:
20 0 * * * /bin/curator --host es-1 close indices --older-than 30 --time-unit days --timestring '%Y.%m.%d'
30 0 * * * /bin/curator --host es-1 delete indices --older-than 60 --time-unit days --timestring '%Y.%m.%d'
The same command runs fine when I run it manually from the command line:
sudo curator --host es-1 close indices --older-than 30 --time-unit days --timestring '%Y.%m.%d'
sudo curator --host es-1 delete indices --older-than 60 --time-unit days --timestring '%Y.%m.%d'
Any idea what im missing??
Second question, as you can see from the above commands im pointing directly to the host es-1. Is there anyway of modifying this so it will pick any of the hosts in the cluster? I want the command to run even if one of the hosts is down.
Frequently, cron can have issues with percent signs % in commands. Sometimes it doesn't pick up all of the flags because it doesn't like long command lines. I recommend a wrapper script instead.
Curator shouldn't need to be run as root, by the way. It only needs access to a client host/IP address.
#closes open indices after 30 days
curator --host es-1 close indices --older-than 30 --time-unit days --timestring '%Y.%m.%d'
#delete closed indices after 60 days
curator --host es-1 delete indices --older-than 60 --time-unit days --timestring '%Y.%m.%d'
Should work, yes. But all of the STDOUT will be emailed to you. Perhaps you will want to set a --logfile in these lines. You could temporarily add a --dry-run flag and set an additional cron entry a few minutes into the future and see what the log files show.
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.