Elastic searh not running after server restarted

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 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:

    ● 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.

@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

@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.

@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.

@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:

#
# /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.

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.

@Coinology I tried twice. Didn't works.

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

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

Nope. Didn't work.

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

df /tmp

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

@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

1 Like

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