# Elastic searh not running after server restarted

**URL:** <https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909>\
**Category:** Elasticsearch\
**Created:** [June 5, 2020, 8:01am UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909 "2020-06-05T08:01:25Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![justaniceguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justaniceguy/32/69769_2.png) [@justaniceguy](https://discuss.elastic.co/u/justaniceguy)\
**Post date:** [June 5, 2020, 8:01am UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/1 "2020-06-05T08:01:26Z")

</div>

Hi, I am new to Elastic search. I just installed made my first installation on a CentOS 7 and it was working, then I tried to config the tried to configure Elasticsearch to start automatically when the system boots up as explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html#rpm-running-systemd) and restarted the server. Now I can't start ElasticSearch.

When I try to run it, I get this error:

`Job for elasticsearch.service failed because the control process exited with error code. See "systemctl status elasticsearch.service" and "journalctl -xe" for details.`

When I run the `systemctl status elasticsearch.service` I get this:

```auto
    ● elasticsearch.service - Elasticsearch
       Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendo r preset: disabled)
       Active: failed (Result: exit-code) since Fri 2020-06-05 00:38:30 MST; 27s ago
         Docs: https://www.elastic.co
      Process: 21761 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${ PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
     Main PID: 21761 (code=exited, status=1/FAILURE)
       CGroup: /system.slice/elasticsearch.service

```

I reinstalled Elastic search several times, but the issue continues.

---

<div class="post-metadata">

**Author:** ![Coinology](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Coinology](https://discuss.elastic.co/u/Coinology)\
**Post date:** [June 5, 2020, 10:32pm UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/4 "2020-06-05T22:32:52Z")

</div>

@justaniceguy Can you check this link, perform the suggestion, and let us know the results?

[https://www.elastic.co/guide/en/elasticsearch/reference/current/executable-jna-tmpdir.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/executable-jna-tmpdir.html)

---

<div class="post-metadata">

**Author:** ![justaniceguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justaniceguy/32/69769_2.png) [@justaniceguy](https://discuss.elastic.co/u/justaniceguy)\
**Post date:** [June 6, 2020, 1:11am UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/5 "2020-06-06T01:11:36Z")

</div>

@Coinology I am sorry, I read it a couple of time but I'm not sure what I am supposed to do.

I ran `mount -o remount,noexec /tmp` but still getting the error: Job for elasticsearch.service failed because the control process exited with error code. See "systemctl status elasticsearch.service" and "journalctl -xe" for details.

---

<div class="post-metadata">

**Author:** ![Coinology](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Coinology](https://discuss.elastic.co/u/Coinology)\
**Post date:** [June 6, 2020, 2:30am UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/6 "2020-06-06T02:30:49Z")

</div>

@justaniceguy If I am correct, the problem stems from `/tmp` being mounted with the `noexec` option. You will want to mount it _without_ this option.

Try to do `mount -o remount,exec /tmp` - I would think that should work. To prevent this type of behavior on startup, I believe you would want to edit `/etc/fstab` and remove `noexec`.

If you prefer, you can also change the location of the JNA temporary directory using the `-Djna.tmpdir=<path>` JVM option.

---

<div class="post-metadata">

**Author:** ![justaniceguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justaniceguy/32/69769_2.png) [@justaniceguy](https://discuss.elastic.co/u/justaniceguy)\
**Post date:** [June 6, 2020, 3:56am UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/7 "2020-06-06T03:56:27Z")

</div>

@coinology Thanks, the `mount -o remount,exec /tmp` command works like a charm.  
Now I am trying to remove `noexec` from `/etc/fstab` but I couldn't find it there. This is the content of the file:

```auto
#
# /etc/fstab
# Created by anaconda on Wed Aug 21 11:03:58 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/vda1 / xfs defaults,uquota 0 0

/usr/swpDSK swap swap defaults 0 0
/usr/tmpDSK /tmp ext3 defaults,noauto 0 0

```

As I couldn't find it there, I restarted the server to see If I would need to remove `noexe` again, and I needed it.

I am very happy to to be able to run Elasticsearch again. I how you can help me with this too.

---

<div class="post-metadata">

**Author:** ![Coinology](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Coinology](https://discuss.elastic.co/u/Coinology)\
**Post date:** [June 6, 2020, 2:39pm UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/8 "2020-06-06T14:39:08Z")

</div>

> [@justaniceguy](#):
>
> `/usr/tmpDSK /tmp ext3 defaults,noauto 0 0`

Try changing this line to

`/usr/tmpDSK /tmp ext3 defaults 0 0`

The problem may have actually been that /tmp just wasn't mounted at startup.

---

<div class="post-metadata">

**Author:** ![justaniceguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justaniceguy/32/69769_2.png) [@justaniceguy](https://discuss.elastic.co/u/justaniceguy)\
**Post date:** [June 6, 2020, 10:09pm UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/9 "2020-06-06T22:09:49Z")

</div>

@Coinology I tried twice. Didn't works.

---

<div class="post-metadata">

**Author:** ![Coinology](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Coinology](https://discuss.elastic.co/u/Coinology)\
**Post date:** [June 7, 2020, 1:51am UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/10 "2020-06-07T01:51:57Z")

</div>

@justaniceguy hmm... What if you try this:

` /usr/tmpDSK /tmp ext3 rw,suid,dev,exec,auto,nouser,async 0 0`

---

<div class="post-metadata">

**Author:** ![justaniceguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justaniceguy/32/69769_2.png) [@justaniceguy](https://discuss.elastic.co/u/justaniceguy)\
**Post date:** [June 7, 2020, 3:22am UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/11 "2020-06-07T03:22:01Z")

</div>

Nope. Didn't work.

---

<div class="post-metadata">

**Author:** ![Coinology](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Coinology](https://discuss.elastic.co/u/Coinology)\
**Post date:** [June 7, 2020, 2:37pm UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/12 "2020-06-07T14:37:49Z")

</div>

@justaniceguy can you run `df /tmp` and share the results?

---

<div class="post-metadata">

**Author:** ![justaniceguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justaniceguy/32/69769_2.png) [@justaniceguy](https://discuss.elastic.co/u/justaniceguy)\
**Post date:** [June 7, 2020, 3:27pm UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/13 "2020-06-07T15:27:40Z")

</div>

**df /tmp**

> Filesystem 1K-blocks Used Available Use% Mounted on  
> /dev/loop0 3997376 8484 3779180 1% /tmp

---

<div class="post-metadata">

**Author:** ![justaniceguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justaniceguy/32/69769_2.png) [@justaniceguy](https://discuss.elastic.co/u/justaniceguy)\
**Post date:** [June 7, 2020, 7:58pm UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/14 "2020-06-07T19:58:32Z")

</div>

@Coinology I think the `noexec` is being added by `/scripts/securetmp`  
When I run `mount` I see:

```
/usr/tmpDSK on /tmp type ext3 (rw,relatime,data=ordered)
/usr/tmpDSK on /var/tmp type ext3 (rw,nosuid,noexec,relatime,data=ordered)

```

**EDIT**

Yes, it was the problem. Solved it by following the steps at: [https://forums.cpanel.net/threads/separating-var-tmp-from-tmp.318601/#post-1392101](https://forums.cpanel.net/threads/separating-var-tmp-from-tmp.318601/#post-1392101)

---

<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, 2020, 7:58pm UTC](https://discuss.elastic.co/t/elastic-searh-not-running-after-server-restarted/235909/15 "2020-07-05T19:58:44Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
