FS#56393 - [elasticsearch] Not starting
Attached to Project:
Community Packages
Opened by Francois (francoism90) - Monday, 20 November 2017, 20:19 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Wednesday, 29 November 2017, 09:45 GMT
Opened by Francois (francoism90) - Monday, 20 November 2017, 20:19 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Wednesday, 29 November 2017, 09:45 GMT
|
Details
Description:
$ sudo systemctl status elasticsearch.service ● elasticsearch.service - Elasticsearch Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2017-11-20 21:16:09 CET; 1min 13s ago Docs: http://www.elastic.co Process: 15228 ExecStart=/usr/bin/elasticsearch -d -p /run/elasticsearch/elasticsearch.pid (code=exited, status=0/SUCCESS) Main PID: 15250 (code=exited, status=1/FAILURE) Nov 20 21:16:09 archie systemd[1]: elasticsearch.service: Service hold-off time over, scheduling restart. Nov 20 21:16:09 archie systemd[1]: elasticsearch.service: Scheduled restart job, restart counter is at 5. Nov 20 21:16:09 archie systemd[1]: Stopped Elasticsearch. Nov 20 21:16:09 archie systemd[1]: elasticsearch.service: Failed with result 'exit-code'. Nov 20 21:16:09 archie systemd[1]: Failed to start Elasticsearch. Additional info: * elasticsearch 6.0.0-1 * clean install, removed all files, logs, etc. Steps to reproduce: 1. Install elasticsearch 2. Start with systemctl 3. Crash after a few seconds |
This task depends upon
Closed by Massimiliano Torromeo (mtorromeo)
Wednesday, 29 November 2017, 09:45 GMT
Reason for closing: Fixed
Additional comments about closing: elasticsearch-6.0.0-3
Wednesday, 29 November 2017, 09:45 GMT
Reason for closing: Fixed
Additional comments about closing: elasticsearch-6.0.0-3
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)
Active: activating (start) since Mon 2017-11-20 21:20:37 CET; 80ms ago
Docs: http://www.elastic.co
Main PID: 16331 (code=exited, status=1/FAILURE); Control PID: 16356 (elasticsearch)
Tasks: 10 (limit: 4915)
CGroup: /system.slice/elasticsearch.service
├─16356 /bin/bash /usr/bin/elasticsearch -d -p /run/elasticsearch/elasticsearch.pid
└─16357 /usr/lib/jvm/default-runtime/bin/java -cp /usr/share/elasticsearch/lib/* org.elasticsearch.tools.JavaVersionChecker
Nov 20 21:20:37 archie systemd[1]: Starting Elasticsearch...
$ /usr/lib/jvm/default-runtime/bin/java -cp /usr/share/elasticsearch/lib/* org.elasticsearch.tools.JavaVersionChecker
Error: Could not find or load main class .usr.share.elasticsearch.lib.HdrHistogram-2.1.9.jar
Think this is something in the java properties.
- sed -re 's;#\s*(path\.conf:).*$;\1 /etc/elasticsearch;' \
- -e '0,/#\s*(path\.data:).*$/s;;\1 /var/lib/elasticsearch;' \
- -e 's;#\s*(path\.work:).*$;\1 /tmp/elasticsearch;' \
- -e 's;#\s*(path\.logs:).*$;\1 /var/log/elasticsearch;' \
- -i config/elasticsearch.yml
https://git.archlinux.org/svntogit/community.git/commit/trunk/PKGBUILD?h=packages/elasticsearch&id=99a633f618dca8cc7fd99725f19832b80f759e07
As the elasticsearch.service systemd file specifies:
WorkingDirectory=/usr/share/elasticsearch
elasticsearch tries to create log and data files in this directory. However /usr/share/elasticsearch is owned by root (and in any case no the right place to put those files.)
Instead of relying on a specific configuration being present I now symlinked the logs directory to var/log so that it will work even if you don't have path.logs configured in elasticsearch.yml.
$ sudo systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2017-11-24 19:30:19 CET; 24ms ago
Docs: http://www.elastic.co
Process: 1488 ExecStart=/usr/bin/elasticsearch -d -p /run/elasticsearch/elasticsearch.pid (code=exited, status=0/SUCCESS)
Main PID: 1742 (code=exited, status=1/FAILURE)
Nov 24 19:30:19 nas1 systemd[1]: elasticsearch.service: Service hold-off time over, scheduling restart.
Nov 24 19:30:19 nas1 systemd[1]: elasticsearch.service: Scheduled restart job, restart counter is at 5.
Nov 24 19:30:19 nas1 systemd[1]: Stopped Elasticsearch.
Nov 24 19:30:19 nas1 systemd[1]: elasticsearch.service: Start request repeated too quickly.
Nov 24 19:30:19 nas1 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Nov 24 19:30:19 nas1 systemd[1]: Failed to start Elasticsearch.
java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:70) ~[elasticsearch-6.0.0.jar:6.0.0]
As previous config files also configured the path.work a symbolic link to /tmp/elasticsearch might be required as well.
@webnard a quick fix is to change your /etc/elasticsearch/elasticsearch.yaml and change:
path.conf: /etc/elasticsearch
path.data: /var/lib/elasticsearch
path.work: /tmp/elasticsearch
path.logs: /var/log/elasticsearch
I don't think path.work is used anymore by elasticsearch though.