![]() So when the PID_FILE is trying to create a file "$PID_DIR/$NAME.pid" ( /var/run/elasticsearch/elasticseach.pid) in $PID_DIR ( /var/run/elasticsearch/), it is getting: touch: cannot touch ‘/var/run/elasticsearch/elasticsearch.pid’: No such file or directoryĮrror as the directory /var/run/elasticsearch does not exists already.Ībout the JAVA_HOME variable, the script /etc/init.d/elasticsearch is not using the system's variable rather using/creating its own version of the variable that is well defined in the script.Īccording to the script, if JAVA_HOME is not set in /etc/default/elasticsearch it will try to set it manually by searching for certain files in certain directories, otherwise it will left it blank. The NAME and PID_FILE are set as: NAME=elasticsearch In the script the PID_DIR variable is set as : PID_DIR=/var/run/elasticsearchīut there is no such directory exists and there is command to create it in the script too. ![]() The problem turned out to be the SysV script /etc/init.d/elasticsearch itself. ![]() JAVA_HOME=/home/mockie/softwares/jdk1.8.0_45Īnd it works! but what I want is to use sudo /etc/init.d/elasticsearch start without sudo su first. This is full code for etc/init.d/elasticsearch :Īnd this is my etc/environment: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" I also tried debug /etc/init.d/elasticsearch like this: echo "$JAVA_HOME/dodol"Īnd the result was empty and only return "/dodol". I got the result /home/mockie/softwares/jdk1.8.0_45 for the both which is correct path for my JAVA. I tried debug the JAVA_HOME variable in terminal like this: This is the command I use to run elasticsearch: ![]() bashrc, etc/environment, etc/.profile all fail. Set JAVAHOME Path on Ubuntu Locate Java’s installation directory: ls -l /usr/lib/jvm Check Java Install Directory in Ubuntu Temporarily Set JAVAHOME in Ubuntu To temporarily set the JAVAHOME path in Ubuntu. I'm trying to set JAVA_HOME for elasticsearch but no luck till now.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |