Elasticsearch错误启动服务

时间:2016-07-04 06:15:00

标签: linux elasticsearch java-8 logstash java-7

我在启动elasticsearch时遇到问题,启动命令是:

cd /etc/init.d && ./elasticsearch start

Out put。

/opt/jdk1.8.0_77 uno
JAVA /opt/jdk1.8.0_77/bin/java
Starting elasticsearch:                                    [  OK  ]

但执行状态我得到:" elasticsearch死了但是锁定了"

我尝试在/ var / lock / subsys中删除" elasticsearch"但是,再次生成此文件。

在日志中说。

java.lang.RuntimeException: Java version: 1.7.0_40 suffers from critical bug https://bugs.openjdk.java.net/browse/JDK-8024830 which can cause data corruption.
Please upgrade the JVM, see http://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html for current recommendations.
If you absolutely cannot upgrade, please add -XX:-UseSuperWord to the JVM_OPTS environment variable.
Upgrading is preferred, this workaround will result in degraded performance.

但是这个过程是从java 8开始的,

elasticsearch      26918  0.8  1.0 30526952 724324 ?     Sl   Jul03   1:29 /opt/jdk1.8.0_77/bin/java -Xms256m -Xmx1g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Delasticsearch -Des.foreground=yes -Des.path.home=/opt/elasticsearch -cp :/opt/elasticsearch/lib/elasticsearch-1.7.0.jar:/opt/elasticsearch/lib/*:/opt/elasticsearch/lib/sigar/* org.elasticsearch.bootstrap.Elasticsearch

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:1)

验证java选择

  

替代--config java

确保java 8正在使用中。 Elasticsearch至少需要Java 8。

请尝试在/etc/elasticsearch/elasticsearch.yml中设置变量:

  

path.data:path / to / data

     

path.work:path / to / work

     

path.logs:/ var / log / elasticsearch

     

path.conf:/ etc / elasticsearch

注意:为该文件夹授予用户“elasticsearch”访问权限 elasticsearch使用:

chown -R elasticsearch / path / to / data chown -R elasticsearch / path / to / work