You are not logged in.
Hi all
I am installing the elasticsearch package from pacman and coming across this error when I start:
Nov 25 14:08:46 Nexus systemd[1]: Starting Elasticsearch...
Nov 25 14:08:46 Nexus systemd[1]: elasticsearch.service: PID file /run/elasticsearch/elasticsearch.pid not readable (yet?) after start: No such file or directory
Nov 25 14:08:47 Nexus systemd[1]: Started Elasticsearch.
Nov 26 01:05:14 Nexus systemd[1]: Stopping Elasticsearch...
Nov 26 01:05:16 Nexus systemd[1]: Stopped Elasticsearch.Here is the service file from /usr/lib/systemd/system/elasticsearch.service:
[Unit]
Description=Elasticsearch
Documentation=http://www.elastic.co
Wants=network.target
After=network.target
[Service]
Type=forking
RuntimeDirectory=elasticsearch
PIDFile=/run/elasticsearch/elasticsearch.pid
Environment=JAVA_HOME=/usr/lib/jvm/default-runtime
Environment=ES_HOME=/usr/share/elasticsearch
Environment=CONF_DIR=/etc/elasticsearch
Environment=DATA_DIR=/var/lib/elasticsearch
Environment=LOG_DIR=/var/log/elasticsearch
EnvironmentFile=-/etc/default/elasticsearch
WorkingDirectory=/usr/share/elasticsearch
User=elasticsearch
Group=elasticsearch
ExecStart=/usr/bin/elasticsearch -d \
-p /run/elasticsearch/elasticsearch.pid \
-E default.path.home=${ES_HOME} \
-E default.path.logs=${LOG_DIR} \
-E default.path.data=${DATA_DIR} \
-E default.path.conf=${CONF_DIR}
SuccessExitStatus=143
LimitNOFILE=65536
LimitMEMLOCK=infinity
TimeoutStopSec=120
Restart=on-failure
[Install]
WantedBy=multi-user.targetThe file and folder /run/elasticsearch/elasticsearch.pid should be created and destroyed when the app starts and stops by systemd. From this I thought that by default the folder and file /run/elasticsearch/elasticsearch.pid should not exist until I start the process has started....
Any help would be much appreciated.
Last edited by tsangares (2016-12-13 04:03:01)
Offline
That looks more like an informational message than an error. It could indicate a source for any follow-up errors, but elasticsearch successfully starts one second later and continues to run for about 11 hours, so it doesn't seem to be more than a (not terribly significant) timing error.
Systemd is telling you it can't read the file "(yet?)", but your thread title says that elastic search cannot make the pid file (at all). Did you check its run directory at any point between the "started ..." and "stopping ..." messages? I suspect elastic search does create the pid file, but somehow slightly too late. That might still be a bug worth reporting, but it doesn't seem to prevent the service from starting.
Offline
I think I could have given you better error messages. Elasticsearch does NOT start. I just tried to restart the process and it spat out this one:
Dec 12 19:48:31 Nexus systemd[1]: Starting Elasticsearch...
Dec 12 19:48:31 Nexus systemd[1]: elasticsearch.service: PID file /run/elasticsearch/elasticsearch.pid not readable (yet?) after start: No such file or directory
Dec 12 19:48:31 Nexus systemd[1]: elasticsearch.service: Daemon never wrote its PID file. Failing.
Dec 12 19:48:31 Nexus systemd[1]: Failed to start Elasticsearch.
Dec 12 19:48:31 Nexus systemd[1]: elasticsearch.service: Unit entered failed state.
Dec 12 19:48:31 Nexus systemd[1]: elasticsearch.service: Failed with result 'resources'.
Dec 12 19:48:31 Nexus systemd[1]: elasticsearch.service: Service hold-off time over, scheduling restart.
Dec 12 19:48:31 Nexus systemd[1]: Stopped Elasticsearch.
Dec 12 19:48:31 Nexus systemd[1]: elasticsearch.service: Start request repeated too quickly.
Dec 12 19:48:31 Nexus systemd[1]: Failed to start Elasticsearch.
Dec 12 19:48:31 Nexus systemd[1]: elasticsearch.service: Unit entered failed state.
Dec 12 19:48:31 Nexus systemd[1]: elasticsearch.service: Failed with result 'start-limit-hit'.I changed the system service a little bit. I will look further on the elastic search github for more help. Although, I was thinking that this was some simple service problem?
Last edited by tsangares (2016-12-13 02:48:51)
Offline
Hey I fixed it. It was a silly issue, I have java 7 running and elasticsearch uses java 8.
I found this out because I tried to run elasticsearch without the service and it threw an error at me that led me to this issue on their github.
This is the error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/bootstrap/Elasticsearch : Unsupported major.minor version 52.0I simply removed my headless version of java 7:
pacman -Rsc jre7-openjdk-headlessI used the java files on the wiki as reference.
After installing java 8 and elasticsearch it worked like a Charm!
Thank you for the help Raynman. Your comment gave me motivation to look elsewhere.
Offline
I'm glad you figured it out, but that wouldn't work if you need/want java 7 as the default runtime.
I've taken a look at the elasticsearch package and you can change JAVA_HOME in /etc/default/elasticsearch if you want to leave java 7 as the default. That file is used by the systemd service. To run elasticsearch manually you'd have to take care of setting JAVA_HOME yourself.
Maybe the package should be fixed to use java-8-openjdk in JAVA_HOME instead of assuming the default is set to java 8, but I can't find anything about this in the Java package guidelines. You could open a bug report and see if anything comes of it, or chime in on this open bug (possibly the same underlying issue).
Offline