Has anyone here installed the latest version of Elasticsearch on a Ubuntu? If so you might have encountered the elasticsearch PID_DIT issue when rebooting the Ubuntu server.
The file PID file is written to this directory: /var/run/elasticsearch but it's not actually there on Linux reboot because it gets deleted by ubuntu.This was not an issue in earlier versions (or at least not in 1.3.9). Is it possible to make elasticsearch write the pid-file to another location that doesn't get cleaned up by elasticsearch?
@magnusbaeck The pid file being deleted is not the problem, it's the folder in which elasticsearch wants to store that is being deleted (/var/run/elasticsearch --> elasticsearch folder) so when it tries to insert it there on startup, it can't do it and simply refuses to start.
@Trident50 We found a solution. Open the elasticsearch file in /etc/init.d/ and change the PID_DIR from "/var/run/elasticsearch" to "/var/run" , now it will put the PID file there.
Found that the solution which I have posted above won't work as the folder /var/run/elasticsearch itself will gets deleted on every restart. So as @arno mentioned in the above solution it is recommended to change the PID_DIR attribute. Just follow the below instructions.
Go to /etc/init.d
There you can see the elasticsearch binary. Open the file with your favorite editor with root privileges. sudo nano elasticsearch
Change the value of PID_DIR attribute from /var/run/elasticsearch to /var/run
Save the file and restart elasticsearch service. sudo service elasticsearch restart
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.