Elasticsearch在Ubuntu 16.04中停止工作

时间:2018-04-10 10:21:50

标签: java ubuntu elasticsearch

我根据提供的信息here在nextcloud中成功安装了elasticsearch和fulltextsearch。

搜索工作正常。最近我注意到elasticsearch服务无法正常启动。当我最初手动重启时,服务似乎运行正常。

sudo service elasticsearch status
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: active (running) since Di 2018-04-10 12:10:15 CEST; 1s ago
     Docs: http://www.elastic.co
 Main PID: 5958 (java)
    Tasks: 6
   Memory: 432.7M
      CPU: 1.391s
   CGroup: /system.slice/elasticsearch.service
           └─5958 /usr/bin/java -Xms3g -Xmx3g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=t...

但是大约10秒后,它停止了:

sudo service elasticsearch status
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Di 2018-04-10 12:10:23 CEST; 24s ago
     Docs: http://www.elastic.co
  Process: 5958 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
 Main PID: 5958 (code=exited, status=1/FAILURE)

Apr 10 12:10:15 Ubuntu-Server systemd[1]: Started Elasticsearch.
Apr 10 12:10:23 Ubuntu-Server systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Apr 10 12:10:23 Ubuntu-Server systemd[1]: elasticsearch.service: Unit entered failed state.
Apr 10 12:10:23 Ubuntu-Server systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

我在Ubuntu 16.04上使用java版本

运行elasticsearch版本6.2.3
java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

我想提供更详细的错误日志,但我不知道在哪里搜索它们。请告诉我需要哪些信息以及在哪里找到它。

非常感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

您是否尝试升级虚拟内存最大映射计数? https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html

如果没有这种改变,ES会在启动后立即关闭。

如果是这样,请尝试从日志中发布更多信息 日志应位于此处:

/var/log/elasticsearch
/var/log/syslog

或输入:

journalctl -xe并找到一些关于:"Elasticsearch (....) exited"

的内容