# Starting Elasticsearch failed

**URL:** <https://discuss.elastic.co/t/starting-elasticsearch-failed/337616>\
**Category:** Elasticsearch\
**Created:** [July 5, 2023, 6:32am UTC](https://discuss.elastic.co/t/starting-elasticsearch-failed/337616 "2023-07-05T06:32:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephane\_chan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephane_chan/32/122193_2.png) [@stephane\_chan](https://discuss.elastic.co/u/stephane_chan)\
**Post date:** [July 5, 2023, 6:32am UTC](https://discuss.elastic.co/t/starting-elasticsearch-failed/337616/1 "2023-07-05T06:32:19Z")

</div>

Hi,  
Why does the elasticsearch.service status always give me this every time I start/restart my server? .

```auto
● elasticsearch.service - Elasticsearch
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
     Active: failed (Result: timeout) since Wed 2023-07-05 04:58:42 UTC; 38min ago
       Docs: https://www.elastic.co
    Process: 1421 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (>
   Main PID: 1421 (code=killed, signal=TERM)
      Tasks: 0 (limit: 38413)
     Memory: 33.8M
     CGroup: /system.slice/elasticsearch.service

Jul 05 04:57:27 srv-elasticsearch systemd[1]: Starting Elasticsearch...
Jul 05 04:58:42 srv-elasticsearch systemd[1]: elasticsearch.service: start operation timed out. Termina>
Jul 05 04:58:42 srv-elasticsearch systemd[1]: elasticsearch.service: Failed with result 'timeout'.
Jul 05 04:58:42 srv-elasticsearch systemd[1]: Failed to start Elasticsearch.

```

Then afterwards, I always have to restart it manually by running: sudo systemctl restart elasticsearch.service to get it to start.There are no other services running apart from elasticsearch and kibana

My server have this config:

- 4 CPU
- 32 GB RAM

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [July 5, 2023, 7:03am UTC](https://discuss.elastic.co/t/starting-elasticsearch-failed/337616/2 "2023-07-05T07:03:31Z")

</div>

Go to `/var/log/elasticsearch/<clustername>.log` and check messages.

---

<div class="post-metadata">

**Author:** ![stephane\_chan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephane_chan/32/122193_2.png) [@stephane\_chan](https://discuss.elastic.co/u/stephane_chan)\
**Post date:** [July 5, 2023, 7:44am UTC](https://discuss.elastic.co/t/starting-elasticsearch-failed/337616/3 "2023-07-05T07:44:33Z")

</div>

I looked in the logs but everything looked normal, but when I ran

```auto
sudo journalctl --unit elasticsearch

```

it gave me this:

```auto
Jul 04 17:25:37 srv-elasticsearch systemd[1]: Stopped Elasticsearch.
-- Reboot --
Jul 05 04:57:27 srv-elasticsearch systemd[1]: Starting Elasticsearch...
Jul 05 04:58:42 srv-elasticsearch systemd[1]: elasticsearch.service: start operation timed out. Termina>
Jul 05 04:58:42 srv-elasticsearch systemd[1]: elasticsearch.service: Failed with result 'timeout'.
Jul 05 04:58:42 srv-elasticsearch systemd[1]: Failed to start Elasticsearch.
Jul 05 05:38:29 srv-elasticsearch systemd[1]: Starting Elasticsearch...
Jul 05 05:38:55 srv-elasticsearch systemd[1]: Started Elasticsearch.

```

---

<div class="post-metadata">

**Author:** ![stephane\_chan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephane_chan/32/122193_2.png) [@stephane\_chan](https://discuss.elastic.co/u/stephane_chan)\
**Post date:** [July 11, 2023, 5:43am UTC](https://discuss.elastic.co/t/starting-elasticsearch-failed/337616/4 "2023-07-11T05:43:39Z")

</div>

Hi,

I solved the problem by following this post.

> **[How to prevent systemd service start operation from timing out](https://blog.sleeplessbeastie.eu/2020/02/29/how-to-prevent-systemd-service-start-operation-from-timing-out/)**
>
> Specify systemd startup timeout option to prevent service start operation from timing out.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [July 11, 2023, 2:43pm UTC](https://discuss.elastic.co/t/starting-elasticsearch-failed/337616/5 "2023-07-11T14:43:07Z")

</div>

Usually ES can start in 30 sec. Maybe CPU is under load or need time to recover indices. However you have solved.

---

<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 8, 2023, 2:43pm UTC](https://discuss.elastic.co/t/starting-elasticsearch-failed/337616/6 "2023-08-08T14:43:27Z")

</div>

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