Juliver Galleto
Juliver Galleto

Reputation: 9047

Restart Elasticservice once a day using cronjob

In server, I can just do

sudo /etc/init.d/elasticsearch restart

for restarting the Elasticsearch service, now I'm having a problem with the elastic node where it says

no alive nodes found

So I have to restart it by doing so the command above. Is there a way I could schedule the Elasticsearch service restart once a day? I came across with cron jobs but seems not to be working.

Upvotes: 0

Views: 1268

Answers (1)

Greenev
Greenev

Reputation: 909

crontab is just what you need. If your service restarts with sudo, you should set cron jobs for root, to do this run sudo crontab -e and add @daily /etc/init.d/elasticsearch restart

Upvotes: 2

Related Questions