# Installing from source, Elasticsearch does not start

**URL:** <https://community.zammad.org/t/installing-from-source-elasticsearch-does-not-start/10768>\
**Category:** Technical assistance\
**Created:** [January 18, 2023, 1:17pm UTC](https://community.zammad.org/t/installing-from-source-elasticsearch-does-not-start/10768 "2023-01-18T13:17:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mssm](https://community.zammad.org/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@mssm](https://community.zammad.org/u/mssm)\
**Post date:** [January 18, 2023, 1:17pm UTC](https://community.zammad.org/t/installing-from-source-elasticsearch-does-not-start/10768/1 "2023-01-18T13:17:40Z")

</div>

- Operating system: OpenSUSE TW

```auto
# zypper repos --details |grep elast
4 | elasticsearch-7.x | Elasticsearch repository for 7.x packages | Yes | (r ) Yes | Yes | 99 | rpm-md | https://artifacts.elastic.co/packages/7.x/yum |

# zypper info elasticsearch
Loading repository data...
Reading installed packages...

Information for package elasticsearch:
--------------------------------------
Repository : Elasticsearch repository for 7.x packages
Name : elasticsearch
Version : 7.17.8-1
Arch : x86_64
Vendor : Elasticsearch
Installed Size : 501.9 MiB
Installed : Yes (automatically)
Status : up-to-date
Source package : elasticsearch-7.17.8-1.
Upstream URL : https://www.elastic.co/
Summary : Distributed RESTful search engine built for the cloud
Description : 
    Reference documentation can be found at
      https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html
      and the 'Elasticsearch: The Definitive Guide' book can be found at
      https://www.elastic.co/guide/en/elasticsearch/guide/current/index.html

```

I followed  
[https://docs.zammad.org/en/latest/install/source.html](https://docs.zammad.org/en/latest/install/source.html)  
[https://docs.zammad.org/en/latest/install/elasticsearch.html](https://docs.zammad.org/en/latest/install/elasticsearch.html)

Starting the elasticsearch on OpenSUSE fails:

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

# systemctl status elasticsearch.service
× elasticsearch.service - Elasticsearch
     Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; preset: disabled)
     Active: failed (Result: exit-code) since Wed 2023-01-18 14:10:11 CET; 59s ago
       Docs: https://www.elastic.co
    Process: 12568 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
   Main PID: 12568 (code=exited, status=1/FAILURE)
        CPU: 4.168s

Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.cli.Command.main(Command.java:77)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
Jan 18 14:10:11 zammad02 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jan 18 14:10:11 zammad02 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jan 18 14:10:11 zammad02 systemd[1]: Failed to start Elasticsearch.
Jan 18 14:10:11 zammad02 systemd[1]: elasticsearch.service: Consumed 4.168s CPU time.

# journalctl -xeu elasticsearch.service
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:484)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at java.base/java.nio.file.Files.newOutputStream(Files.java:228)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDirectory.java:410)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDirectory.java:406)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.apache.lucene.store.FSDirectory.createOutput(FSDirectory.java:254)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.common.settings.KeyStoreWrapper.save(KeyStoreWrapper.java:501)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.bootstrap.Bootstrap.loadSecureSettings(Bootstrap.java:272)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.bootstrap.Bootstrap.loadSecureSettings(Bootstrap.java:247)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:364)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.cli.Command.main(Command.java:77)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)
Jan 18 14:10:11 zammad02 systemd-entrypoint[12568]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
Jan 18 14:10:11 zammad02 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStart= process belonging to unit elasticsearch.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Jan 18 14:10:11 zammad02 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit elasticsearch.service has entered the 'failed' state with result 'exit-code'.
Jan 18 14:10:11 zammad02 systemd[1]: Failed to start Elasticsearch.
░░ Subject: A start job for unit elasticsearch.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit elasticsearch.service has finished with a failure.
░░ 
░░ The job identifier is 1153 and the job result is failed.
Jan 18 14:10:11 zammad02 systemd[1]: elasticsearch.service: Consumed 4.168s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit elasticsearch.service completed and consumed the indicated resources.

```

---

<div class="post-metadata">

**Author:** ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)\
**Post date:** [January 30, 2023, 11:36am UTC](https://community.zammad.org/t/installing-from-source-elasticsearch-does-not-start/10768/2 "2023-01-30T11:36:18Z")

</div>

The elasticsearch logfile should contain more information on what exactly happened. Also the whole journalctl output should. With only a small portion of this output nobody will be able to help you with that issue.

The logfile you’re searching lifes in `/var/log/elasticsearch/elasticsearch.log` in default installations.

---

<div class="post-metadata">

**Author:** ![mssm](https://community.zammad.org/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@mssm](https://community.zammad.org/u/mssm)\
**Post date:** [January 30, 2023, 3:31pm UTC](https://community.zammad.org/t/installing-from-source-elasticsearch-does-not-start/10768/3 "2023-01-30T15:31:37Z")

</div>

That log file does not exist. I only found

```auto
# ls -al /var/log/elasticsearch/
total 56
drwxr-s--- 1 elasticsearch elasticsearch 246 Jan 30 16:23 .
drwxr-xr-x 1 root root 1038 Jan 19 00:00 ..
-rw-r--r-- 1 elasticsearch elasticsearch 2800 Jan 30 16:23 gc.log
-rw-r--r-- 1 elasticsearch elasticsearch 2125 Jan 18 12:02 gc.log.00
-rw-r--r-- 1 elasticsearch elasticsearch 2442 Jan 18 12:02 gc.log.01
-rw-r--r-- 1 elasticsearch elasticsearch 2125 Jan 18 12:02 gc.log.02
-rw-r--r-- 1 elasticsearch elasticsearch 2266 Jan 18 12:02 gc.log.03
-rw-r--r-- 1 elasticsearch elasticsearch 2100 Jan 18 12:54 gc.log.04
-rw-r--r-- 1 elasticsearch elasticsearch 2241 Jan 18 12:54 gc.log.05
-rw-r--r-- 1 elasticsearch elasticsearch 2125 Jan 18 14:09 gc.log.06
-rw-r--r-- 1 elasticsearch elasticsearch 2266 Jan 18 14:10 gc.log.07
-rw-r--r-- 1 elasticsearch elasticsearch 2125 Jan 18 14:10 gc.log.08
-rw-r--r-- 1 elasticsearch elasticsearch 2266 Jan 18 14:10 gc.log.09
-rw-r--r-- 1 elasticsearch elasticsearch 2125 Jan 18 15:36 gc.log.10
-rw-r--r-- 1 elasticsearch elasticsearch 2266 Jan 18 15:36 gc.log.11
-rw-r--r-- 1 elasticsearch elasticsearch 2125 Jan 30 16:23 gc.log.12

```

In gc.log I can’t see any errors…  
But in `journalctl -xeu elasticsearch.service` I found:  
`Jan 30 16:25:56 zammad02 systemd-entrypoint[22353]: Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: org.elasticsearch.cli.UserException: unable to create temporary keystore at [/etc/elasticsearch/elasticsearch.keystore.tmp], write permissions required for [/etc/elasticsearch] or run>`

Permissions:

```auto
# ls -al /etc/elasticsearch/
total 44
drwxr-s--- 1 root elasticsearch 264 Jan 17 16:50 .
drwxr-xr-x 1 root root 3814 Jan 20 13:33 ..
-rw-rw---- 1 root elasticsearch 1042 Dec 2 18:35 elasticsearch-plugins.example.yml
-rw-rw---- 1 root elasticsearch 3431 Dec 2 18:35 elasticsearch.yml
-rw-rw---- 1 root elasticsearch 3329 Dec 2 18:35 jvm.options
drwxr-s--- 1 root elasticsearch 0 Dec 2 18:38 jvm.options.d
-rw-rw---- 1 root elasticsearch 19304 Dec 2 18:35 log4j2.properties
-rw-rw---- 1 root elasticsearch 473 Dec 2 18:35 role_mapping.yml
-rw-rw---- 1 root elasticsearch 197 Dec 2 18:35 roles.yml
-rw-rw---- 1 root elasticsearch 0 Dec 2 18:35 users
-rw-rw---- 1 root elasticsearch 0 Dec 2 18:35 users_roles

```

```auto
# chmod -Rc g+w /etc/elasticsearch/
mode of '/etc/elasticsearch/' changed from 2750 (rwxr-s---) to 2770 (rwxrws---)
mode of '/etc/elasticsearch/jvm.options.d' changed from 2750 (rwxr-s---) to 2770 (rwxrws---)

```

Now Elasticsearch is up and running. Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)\
**Post date:** [May 30, 2023, 3:32pm UTC](https://community.zammad.org/t/installing-from-source-elasticsearch-does-not-start/10768/4 "2023-05-30T15:32:12Z")

</div>

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