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

**URL:** https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code-see-systemctl-status-elasticsearch-service-and-journalctl-xe-for-details/279405
**Category:** Elasticsearch
**Created:** [July 22, 2021, 3:18pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code-see-systemctl-status-elasticsearch-service-and-journalctl-xe-for-details/279405 "2021-07-22T15:18:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![scriptdil](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@scriptdil](https://discuss.elastic.co/u/scriptdil)
#### Post date: [July 22, 2021, 3:18pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code-see-systemctl-status-elasticsearch-service-and-journalctl-xe-for-details/279405/1 "2021-07-22T15:18:03Z")

</div>

Hi i am new here. I have been trying to install Elastic search on a second server without success. I cant figure out what is wrong  
Error Message:

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

```

journalctl -xe:

```auto
Jul 22 17:01:50 systemd-entrypoint[16904]: fatal error in thread [main], exiting
Jul 22 17:01:50 systemd-entrypoint[16904]: java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.systemd.Libsystemd.lambda$static$0(Libsystemd.java:23)
Jul 22 17:01:50 systemd-entrypoint[16904]: at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.systemd.Libsystemd.<clinit>(Libsystemd.java:22)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.systemd.SystemdPlugin.sd_notify(SystemdPlugin.java:115)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.systemd.SystemdPlugin.onNodeStarted(SystemdPlugin.java:126)
Jul 22 17:01:50 systemd-entrypoint[16904]: at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.node.Node.start(Node.java:955)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:311)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:406)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.cli.Command.main(Command.java:79)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
Jul 22 17:01:50 systemd-entrypoint[16904]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81)
Jul 22 17:01:50 systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Jul 22 17:01:50 systemd[1]: Failed to start Elasticsearch.
-- Subject: Unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit elasticsearch.service has failed.
--
-- The result is failed.
Jul 22 17:01:50 systemd[1]: Unit elasticsearch.service entered failed state.
Jul 22 17:01:50 systemd[1]: elasticsearch.service failed.
Jul 22 17:01:50 polkitd[628]: Unregistered Authentication Agent for unix-process:16898:9481604 (system bus name :1.9420, object path /org/freedesktop/Polic

```

---

<div class="post-metadata">

### Author: ![scriptdil](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@scriptdil](https://discuss.elastic.co/u/scriptdil)
#### Post date: [July 22, 2021, 3:51pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code-see-systemctl-status-elasticsearch-service-and-journalctl-xe-for-details/279405/2 "2021-07-22T15:51:37Z")

</div>

I solved the problem  
changed in /etc/elasticsearch/jvm.options

```auto
#-Djava.io.tmpdir=${ES_TMPDIR}
-Djava.io.tmpdir=/var/log/elasticsearch

```

---

<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: [August 19, 2021, 3:52pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed-because-the-control-process-exited-with-error-code-see-systemctl-status-elasticsearch-service-and-journalctl-xe-for-details/279405/3 "2021-08-19T15:52:17Z")

</div>

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