我已经阅读了这里提供的三种解决方案。跟着这三个,但是它不起作用。每当我尝试将elasticsearch作为服务运行时:
/etc/init.d/elasticsearch start
它总是给我:
Waiting for ElasticSearch................................ WARNING: ElasticSearch may have failed to start.
现在,当我尝试查找错误日志(/ var / log / elasticsearch)时,它永远不会出现。任何想法?
确保您拥有JDK并指定了JAVA_HOME和ES_HOMEvar。
JAVA_HOME
ES_HOME
以下代码段对我有用:
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
随时可以键入以下内容,以查看程序的作用:
tail -f ES_HOME/logs/elasticsearch.log
最后,您可以使用pid杀死程序。有很多方法。一个简单的如下:
ps -ef |grep elasticsearch kill #PID result of previous command
更容易:
pkill -f elasticsearch