# Elasticsearch won't upstart

**URL:** https://discuss.elastic.co/t/elasticsearch-wont-upstart/45550
**Category:** Elasticsearch
**Created:** [March 28, 2016, 12:49am UTC](https://discuss.elastic.co/t/elasticsearch-wont-upstart/45550 "2016-03-28T00:49:02Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mchomicz](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mchomicz](https://discuss.elastic.co/u/mchomicz)
#### Post date: [March 28, 2016, 12:49am UTC](https://discuss.elastic.co/t/elasticsearch-wont-upstart/45550/1 "2016-03-28T00:49:03Z")

</div>

Hi!

I have been successfully running ELK for a day 🙂

However, after a needed server restart I cannot upstart Elasticsearch from systemctl.

If I run it manually it works.

My set up:

centos7  
elasticsearch-2.2.1-1.noarch

Running from systemctl gives:

` [root@localhost share]# sudo /bin/systemctl status elasticsearch.service  
● elasticsearch.service - Elasticsearch  
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)  
Active: failed (Result: exit-code) since Mon 2016-03-28 01:26:45 BST; 21s ago  
Docs: [http://www.elastic.co](http://www.elastic.co)  
Process: 3936 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -Des.pidfile=${PID\_DIR}/elasticsearch.pid -Des.default.path.home=${ES\_HOME} -Des.default.path.logs=${LOG\_DIR} -Des.default.path.data=${DATA\_DIR} -Des.default.path.conf=${CONF\_DIR} (code=exited, status=127)  
Process: 3934 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)  
Main PID: 3936 (code=exited, status=127)

Mar 28 01:26:45 localhost.localdomain systemd[1]: Starting Elasticsearch...  
Mar 28 01:26:45 localhost.localdomain systemd[1]: Started Elasticsearch.  
Mar 28 01:26:45 localhost.localdomain systemd[1]: elasticsearch.service: main process exited, code=exited, status=127/n/a  
Mar 28 01:26:45 localhost.localdomain systemd[1]: Unit elasticsearch.service entered failed state.  
Mar 28 01:26:45 localhost.localdomain systemd[1]: elasticsearch.service failed.`

All files/folders seem to be in place.

Here is the .service config:

[Unit]  
Description=Elasticsearch  
Documentation=http://www.elastic.co  
Wants=network-online.target  
After=network-online.target

[Service]  
Environment=ES\_HOME=/usr/share/elasticsearch  
Environment=CONF\_DIR=/etc/elasticsearch  
Environment=DATA\_DIR=/var/lib/elasticsearch  
Environment=LOG\_DIR=/var/log/elasticsearch  
Environment=PID\_DIR=/var/run/elasticsearch  
EnvironmentFile=-/etc/sysconfig/elasticsearch

WorkingDirectory=/usr/share/elasticsearch

User=elasticsearch  
Group=elasticsearch

ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec

ExecStart=/usr/share/elasticsearch/bin/elasticsearch   
-Des.pidfile=${PID\_DIR}/elasticsearch.pid   
-Des.default.path.home=${ES\_HOME}   
-Des.default.path.logs=${LOG\_DIR}   
-Des.default.path.data=${DATA\_DIR}   
-Des.default.path.conf=${CONF\_DIR}  
StandardOutput=journal  
StandardError=inherit

# Specifies the maximum file descriptor number that can be opened by this process

LimitNOFILE=65535

# Specifies the maximum number of bytes of memory that may be locked into RAM

# Set to "infinity" if you use the 'bootstrap.mlockall: true' option

# in elasticsearch.yml and 'MAX\_LOCKED\_MEMORY=unlimited' in /etc/sysconfig/elasticsearch

#LimitMEMLOCK=infinity

# Disable timeout logic and wait until process is stopped

TimeoutStopSec=0

# SIGTERM signal is used to stop the Java process

KillSignal=SIGTERM

# Java process is never killed

SendSIGKILL=no

# When a JVM receives a SIGTERM signal it exits with code 143

SuccessExitStatus=143

[Install]  
WantedBy=multi-user.target

# Built for Distribution: RPM-2.2.1 (rpm)`

elasticsearch user is owner of all the above mentioned folders.. I'm not sure where to go.

Any help will be much appreciated!

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [March 28, 2016, 12:58am UTC](https://discuss.elastic.co/t/elasticsearch-wont-upstart/45550/2 "2016-03-28T00:58:49Z")

</div>

What do your ES logs show?

---

<div class="post-metadata">

### Author: ![mchomicz](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mchomicz](https://discuss.elastic.co/u/mchomicz)
#### Post date: [March 28, 2016, 9:24am UTC](https://discuss.elastic.co/t/elasticsearch-wont-upstart/45550/3 "2016-03-28T09:24:05Z")

</div>

Actually I'm not able to find any related logs when is start with systemctl. Based on the config file I expect to find them:

/var/log/elasticsearch/

But nothing is going there anymore. When I start it up manually the logs go into:

/usr/share/elasticsearch/logs/elastic.log

---

<div class="post-metadata">

### Author: ![QuantumDamage](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/quantumdamage/32/5062_2.png) [@QuantumDamage](https://discuss.elastic.co/u/QuantumDamage)
#### Post date: [July 6, 2016, 4:28pm UTC](https://discuss.elastic.co/t/elasticsearch-wont-upstart/45550/4 "2016-07-06T16:28:13Z")

</div>

I believe I'm ending in similar situation on CentOS Linux release 7.2.1511 (Core) with 5.0.0\_alpha4-1.

```
[root@lab elasticsearch]# service elasticsearch status
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-07-06 18:16:35 CEST; 7min ago
     Docs: http://www.elastic.co
  Process: 45928 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid -Edefault.path.logs=${LOG_DIR} -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=${CONF_DIR} (code=exited, status=1/FAILURE)
  Process: 45926 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 45928 (code=exited, status=1/FAILURE)

Jul 06 18:16:35 lab systemd[1]: Starting Elasticsearch...
Jul 06 18:16:35 lab systemd[1]: Started Elasticsearch.
Jul 06 18:16:35 lab systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Jul 06 18:16:35 lab systemd[1]: Unit elasticsearch.service entered failed state.
Jul 06 18:16:35 lab systemd[1]: elasticsearch.service failed.

```

Main problem is that there was no log produced, so I'm not sure how to debug it further.

---

<div class="post-metadata">

### Author: ![Biswajit\_Sahu](https://avatars.discourse-cdn.com/v4/letter/b/3bc359/32.png) [@Biswajit\_Sahu](https://discuss.elastic.co/u/Biswajit_Sahu)
#### Post date: [November 21, 2016, 8:14am UTC](https://discuss.elastic.co/t/elasticsearch-wont-upstart/45550/5 "2016-11-21T08:14:23Z")

</div>

I also ran into the same situation.  
I was using ES 5.0 on CentOS 7.  
I downgraded it to CentOS 6 and now it's working fine.

---

<div class="post-metadata">

### Author: ![JoeLi](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@JoeLi](https://discuss.elastic.co/u/JoeLi)
#### Post date: [January 4, 2017, 8:28am UTC](https://discuss.elastic.co/t/elasticsearch-wont-upstart/45550/6 "2017-01-04T08:28:04Z")

</div>

Get same issue here, I am restarting it and then it stucked there. There is no elasticsearch proces but I cannot start it successfully.

---

<div class="post-metadata">

### Author: ![kanapuliAthavan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kanapuliathavan/32/45544_2.png) [@kanapuliAthavan](https://discuss.elastic.co/u/kanapuliAthavan)
#### Post date: [May 23, 2017, 7:14am UTC](https://discuss.elastic.co/t/elasticsearch-wont-upstart/45550/8 "2017-05-23T07:14:40Z")

</div>

Hi , I have faced the same problem in RHEL where the elasticsearch won't generate logs .  
Then The problem was due to an **extra space in the elasticsearch.yml** file in **/etc/elasticsearch** path.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 10:00pm UTC](https://discuss.elastic.co/t/elasticsearch-wont-upstart/45550/9 "2017-07-05T22:00:10Z")

</div>


