# Job for elasticsearch.service failed

**URL:** <https://discuss.elastic.co/t/job-for-elasticsearch-service-failed/286934>\
**Category:** Elasticsearch\
**Created:** [October 17, 2021, 5:46pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed/286934 "2021-10-17T17:46:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dun7ill](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dun7ill](https://discuss.elastic.co/u/dun7ill)\
**Post date:** [October 17, 2021, 5:46pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed/286934/1 "2021-10-17T17:46:16Z")

</div>

Hi All,

I've installed Elasticsearch 7 on CentOS 7, I faced a problem when I try to start it.  
Sometimes it's work fine, then it's failed !  
Please find the following code ;

```auto
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2021-10-17 17:18:53 UTC; 7s ago
     Docs: https://www.elastic.co
  Process: 5563 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
 Main PID: 5563 (code=exited, status=1/FAILURE)
   CGroup: /system.slice/elasticsearch.service

Oct 17 17:18:53 ip-97-74-80-153.ip.secureserver.net systemd-entrypoint[5563]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75)
Oct 17 17:18:53 ip-97-74-80-153.ip.secureserver.net systemd-entrypoint[5563]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:114)
Oct 17 17:18:53 ip-97-74-80-153.ip.secureserver.net systemd-entrypoint[5563]: at org.elasticsearch.cli.Command.main(Command.java:79)
Oct 17 17:18:53 ip-97-74-80-153.ip.secureserver.net systemd-entrypoint[5563]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:123)
Oct 17 17:18:53 ip-97-74-80-153.ip.secureserver.net systemd-entrypoint[5563]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81)
Oct 17 17:18:53 ip-97-74-80-153.ip.secureserver.net systemd-entrypoint[5563]: ERROR: Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/MagentoCluster.log
Oct 17 17:18:53 ip-97-74-80-153.ip.secureserver.net systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Oct 17 17:18:53 ip-97-74-80-153.ip.secureserver.net systemd[1]: Failed to start Elasticsearch.
Oct 17 17:18:53 ip-97-74-80-153.ip.secureserver.net systemd[1]: Unit elasticsearch.service entered failed state.
Oct 17 17:18:53 ip-97-74-80-153.ip.secureserver.net systemd[1]: elasticsearch.service failed.

```

---

<div class="post-metadata">

**Author:** ![zx8086](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zx8086/32/94917_2.png) [@zx8086](https://discuss.elastic.co/u/zx8086)\
**Post date:** [October 17, 2021, 8:07pm UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed/286934/2 "2021-10-17T20:07:09Z")

</div>

Welcome @dun7ill to the community,

Have you checked the log for errors ? Can you share your elk configuration?

> [@dun7ill](#):
>
> `/var/log/elasticsearch/MagentoCluster.log`

---

<div class="post-metadata">

**Author:** ![dun7ill](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dun7ill](https://discuss.elastic.co/u/dun7ill)\
**Post date:** [October 18, 2021, 9:48am UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed/286934/3 "2021-10-18T09:48:41Z")

</div>

Hi Friend,

It's worked by this  
ES\_JAVA\_OPTS="-Djna.tmpdir=/var/lib/Elasticsearch/tmp"

But why it's stopped many times ? each time I should put the following code  
sudo systemctl start Elasticsearch.service

Could you please help me ?

---

<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:** [November 15, 2021, 9:49am UTC](https://discuss.elastic.co/t/job-for-elasticsearch-service-failed/286934/4 "2021-11-15T09:49:36Z")

</div>

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