简体   繁体   中英

elasticsearch systemd service failing

I have just switched to systemd on my linux 14.10 and now my elasticsearch service is not starting properly

elasticsearch.service             loaded failed failed  

a systemctl status gives me the following :

elasticsearch.service - Starts and stops a single elasticsearch instance on this system
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled)
   Active: failed (Result: exit-code) since Mon 2015-04-13 23:23:54 CEST; 4s ago
     Docs: http://www.elasticsearch.org
  Process: 1227 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -Des.default.config=$CONF_FILE -Des.default.path.home=$ES_HOME -Des.default.path.logs=$LOG_DIR -Des.default.path.data=$DATA_DIR -Des.default.path.work=$WORK_DIR -Des.default.path.conf=$CONF_DIR (code=exited, status=3)
 Main PID: 1227 (code=exited, status=3)

I have no experience in terms of managing services and I am pretty new to systemd so I don't see how I can resolve this.

Can someone point me in the right direction ? Thanks !

Allright, i got it solved by removing the elasticsearch.service file, disabling the service and reinstalling this:

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo /bin/systemctl start elasticsearch.service

One approach to troubleshoot is to run the following command which kind of similar to what systemd executes. You will unearth problems pretty fast this way. For me it was java path.

sudo -u elasticsearch /usr/share/elasticsearch/bin/elasticsearch \\ -Des.pidfile=/var/run/elasticsearch/elasticsearch.pid \\ -Des.default.path.home=/usr/share/elasticsearch \\ -Des.default.path.logs=/var/log/elasticsearch \\ -Des.default.path.data=/var/lib/elasticsearch \\ -Des.default.path.conf=/etc/elasticsearch

which: no java in (/usr/sbin:/usr/bin:/sbin:/bin) Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM