Can't get elasticsearch to run as a service on Ubuntu 12.0.4 (Natty) - ElasticSearch may have failed to start

六月ゝ 毕业季﹏ 提交于 2019-12-06 10:38:06

问题


I've read three of the solutions provided here and here and here. Followed those three however it doesn't work. Whenever I tried running elasticsearch as a service:

/etc/init.d/elasticsearch start

it always gives me:

Waiting for ElasticSearch................................
WARNING: ElasticSearch may have failed to start.

Now when I try to find the error log (/var/log/elasticsearch), it's never there. ANy idea?


回答1:


Make sure that you have the JDK and you have specified the JAVA_HOME and the ES_HOME vars.

The following snippet works for me:

sudo apt-get install openjdk-6-jdk # if you haven't
sudo export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64 >> /etc/bash.bashrc
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.6.tar.gz
tar xvf elasticsearch-0.90.6.tar.gz
mv elasticsearch-0.90.6 elasticsearch
cd elasticsearch
sudo export ES_HOME=`(pwd)` >> /etc/bash.bashrc
cd ./bin
./elasticsearch -f  # to run in the foreground

Whenever you want, you can type the following, in order to see what the program do:

tail -f ES_HOME/logs/elasticsearch.log

Finally, you can kill the program with the pid. There are a lot of ways. A simple is the following:

ps -ef |grep elasticsearch
kill #PID result of previous command

of more easy:

pkill -f elasticsearch



回答2:


Configure the elastic search in ubuntu. Please check here for the proper guidance.

Installing ElasticSearch on Ubuntu 12.04



来源:https://stackoverflow.com/questions/19862480/cant-get-elasticsearch-to-run-as-a-service-on-ubuntu-12-0-4-natty-elasticse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!