# Elasticsearch code=exited, status=1/FAILURE

**URL:** https://discuss.elastic.co/t/elasticsearch-code-exited-status-1-failure/336595
**Category:** Elasticsearch
**Tags:** elastic-stack-monitoring
**Created:** [June 21, 2023, 1:43pm UTC](https://discuss.elastic.co/t/elasticsearch-code-exited-status-1-failure/336595 "2023-06-21T13:43:21Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![codepan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/codepan/32/122632_2.png) [@codepan](https://discuss.elastic.co/u/codepan)
#### Post date: [June 21, 2023, 1:43pm UTC](https://discuss.elastic.co/t/elasticsearch-code-exited-status-1-failure/336595/1 "2023-06-21T13:43:21Z")

</div>

Fiz a instalação do Elastic 8 no CentOs, mas o mesmo falha ao iniciar.

systemctl status elasticsearch

```auto
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/etc/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2023-06-21 09:56:32 -03; 41min ago
     Docs: https://www.elastic.co
  Process: 6956 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
 Main PID: 6956 (code=exited, status=1/FAILURE)

Jun 21 09:56:04 191-252-212-106.cprapid.com systemd[1]: Starting Elasticsearch...
Jun 21 09:56:08 191-252-212-106.cprapid.com systemd-entrypoint[6956]: Failed to load native library:jansi-2.4.0-d36ddbfd9...
Jun 21 09:56:08 191-252-212-106.cprapid.com systemd-entrypoint[6956]: java.lang.UnsatisfiedLinkError: /tmp/elasticsear...ted
Jun 21 09:56:31 191-252-212-106.cprapid.com systemd-entrypoint[6956]: ERROR: Elasticsearch did not exit normally - che...log
Jun 21 09:56:32 191-252-212-106.cprapid.com systemd-entrypoint[6956]: ERROR: Elasticsearch exited unexpectedly
Jun 21 09:56:32 191-252-212-106.cprapid.com systemd[1]: elasticsearch.service: main process exited, code=exited, stat...LURE
Jun 21 09:56:32 191-252-212-106.cprapid.com systemd[1]: Failed to start Elasticsearch.
Jun 21 09:56:32 191-252-212-106.cprapid.com systemd[1]: Unit elasticsearch.service entered failed state.
Jun 21 09:56:32 191-252-212-106.cprapid.com systemd[1]: elasticsearch.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

```

tail -f /var/log/elasticsearch/elasticsearch.log

```auto
        at org.elasticsearch.cluster.coordination.Publication$PublicationTarget$PublishResponseHandler.onResponse(Publication.java:358) ~[elasticsearch-8.8.1.jar:?]
        at org.elasticsearch.cluster.coordination.Coordinator$8.onResponse(Coordinator.java:1584) ~[elasticsearch-8.8.1.jar:?]
        at org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:50) ~[elasticsearch-8.8.1.jar:?]
        at org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:47) ~[elasticsearch-8.8.1.jar:?]
        at org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72) ~[elasticsearch-8.8.1.jar:?]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983) ~[elasticsearch-8.8.1.jar:?]
        at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) ~[elasticsearch-8.8.1.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1623) ~[?:?]

```

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [June 21, 2023, 1:48pm UTC](https://discuss.elastic.co/t/elasticsearch-code-exited-status-1-failure/336595/2 "2023-06-21T13:48:16Z")

</div>

Olá,

Você precisa compartilhar o início desse log, só parte dele não é suficiente.

Além disse, se está falhando pra iniciar com o `systemctl` você precisa olhar também no `/var/log/messages` e procurar por alguma indicação do motivo da falha do serviço.

---

<div class="post-metadata">

### Author: ![codepan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/codepan/32/122632_2.png) [@codepan](https://discuss.elastic.co/u/codepan)
#### Post date: [June 21, 2023, 2:10pm UTC](https://discuss.elastic.co/t/elasticsearch-code-exited-status-1-failure/336595/3 "2023-06-21T14:10:47Z")

</div>

Olá, obrigado!

/var/log/messages

```auto
Jun 21 09:07:51 systemd-entrypoint: Failed to load native library:jansi-2.4.0-43ba014540da2fd7-libjansi.so.The native library file at /tmp/elasticsearch-1468866660034633082/jansi-2.4.0-43ba014540da2fd7-libjansi.so is not executable, make sure that the directory is mounted on a partition without the noexec flag, or set the jansi.tmpdir system property to point to a proper location. osinfo: Linux/x86_64
Jun 21 09:07:51 systemd-entrypoint: java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-1468866660034633082/jansi-2.4.0-43ba014540da2fd7-libjansi.so: /tmp/elasticsearch-1468866660034633082/jansi-2.4.0-43ba014540da2fd7-libjansi.so: failed to map segment from shared object: Operation not permitted
Jun 21 09:08:23 systemd-entrypoint: ERROR: Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/elasticsearch.log
Jun 21 09:08:24 systemd-entrypoint: ERROR: Elasticsearch exited unexpectedly
Jun 21 09:08:24 systemd: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Jun 21 09:08:24 systemd: Failed to start Elasticsearch.
Jun 21 09:08:24 systemd: Unit elasticsearch.service entered failed state.
Jun 21 09:08:24 systemd: elasticsearch.service failed.
Jun 21 09:32:10 systemd: Starting Elasticsearch...
Jun 21 09:32:14 systemd-entrypoint: Failed to load native library:jansi-2.4.0-7c229787a73ee336-libjansi.so.The native library file at /tmp/elasticsearch-4191744525245378406/jansi-2.4.0-7c229787a73ee336-libjansi.so is not executable, make sure that the directory is mounted on a partition without the noexec flag, or set the jansi.tmpdir system property to point to a proper location. osinfo: Linux/x86_64
Jun 21 09:32:14 systemd-entrypoint: java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-4191744525245378406/jansi-2.4.0-7c229787a73ee336-libjansi.so: /tmp/elasticsearch-4191744525245378406/jansi-2.4.0-7c229787a73ee336-libjansi.so: failed to map segment from shared object: Operation not permitted
Jun 21 09:32:40 systemd-entrypoint: ERROR: Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/elasticsearch.log
Jun 21 09:32:40 systemd-entrypoint: ERROR: Elasticsearch exited unexpectedly
Jun 21 09:32:40 systemd: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Jun 21 09:32:40 systemd: Failed to start Elasticsearch.
Jun 21 09:32:40 systemd: Unit elasticsearch.service entered failed state.
Jun 21 09:32:40 systemd: elasticsearch.service failed.
Jun 21 09:36:00 systemd: Starting Elasticsearch...
Jun 21 09:36:05 systemd-entrypoint: Failed to load native library:jansi-2.4.0-e58e54a34bb81d41-libjansi.so.The native library file at /tmp/elasticsearch-8145469924824954857/jansi-2.4.0-e58e54a34bb81d41-libjansi.so is not executable, make sure that the directory is mounted on a partition without the noexec flag, or set the jansi.tmpdir system property to point to a proper location. osinfo: Linux/x86_64
Jun 21 09:36:05 systemd-entrypoint: java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-8145469924824954857/jansi-2.4.0-e58e54a34bb81d41-libjansi.so: /tmp/elasticsearch-8145469924824954857/jansi-2.4.0-e58e54a34bb81d41-libjansi.so: failed to map segment from shared object: Operation not permitted
Jun 21 09:36:27 systemd-entrypoint: ERROR: Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/elasticsearch.log
Jun 21 09:36:27 systemd-entrypoint: ERROR: Elasticsearch exited unexpectedly
Jun 21 09:36:27 systemd: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Jun 21 09:36:27 systemd: Failed to start Elasticsearch.
Jun 21 09:36:27 systemd: Unit elasticsearch.service entered failed state.
Jun 21 09:36:27 systemd: elasticsearch.service failed.
Jun 21 09:37:44 systemd: Starting Elasticsearch...
Jun 21 09:37:49 systemd-entrypoint: Failed to load native library:jansi-2.4.0-bd276cefa76a63f8-libjansi.so.The native library file at /tmp/elasticsearch-9107953253587356133/jansi-2.4.0-bd276cefa76a63f8-libjansi.so is not executable, make sure that the directory is mounted on a partition without the noexec flag, or set the jansi.tmpdir system property to point to a proper location. osinfo: Linux/x86_64
Jun 21 09:37:49 systemd-entrypoint: java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-9107953253587356133/jansi-2.4.0-bd276cefa76a63f8-libjansi.so: /tmp/elasticsearch-9107953253587356133/jansi-2.4.0-bd276cefa76a63f8-libjansi.so: failed to map segment from shared object: Operation not permitted
Jun 21 09:38:01 systemd: Started Session 53 of user root.
Jun 21 09:38:12 systemd-entrypoint: ERROR: Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/elasticsearch.log
Jun 21 09:38:13 systemd-entrypoint: ERROR: Elasticsearch exited unexpectedly
Jun 21 09:38:13 systemd: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Jun 21 09:38:13 systemd: Failed to start Elasticsearch.
Jun 21 09:38:13 systemd: Unit elasticsearch.service entered failed state.
Jun 21 09:38:13 systemd: elasticsearch.service failed.
Jun 21 09:38:13 systemd-logind: Removed session c2.
Jun 21 09:38:13 systemd: Removed slice User Slice of root.
Jun 21 09:39:00 pure-ftpd: (?@127.0.0.1) [INFO] New connection from 127.0.0.1
Jun 21 09:39:00 pure-ftpd: (?@127.0.0.1) [INFO] __cpanel__ service __auth__ ftpd__QPKoLPoSSfZ5N8lj is now logged in
Jun 21 09:39:00 pure-ftpd: ( __cpanel__ service __auth__ ftpd__QPKoLPoSSfZ5N8lj@127.0.0.1) [INFO] Logout.
Jun 21 09:39:01 systemd: Created slice User Slice of root.
Jun 21 09:39:01 systemd: Started Session 55 of user root.
Jun 21 09:39:01 systemd: Started Session 54 of user root.
Jun 21 09:39:04 systemd: Removed slice User Slice of root.
Jun 21 09:39:34 firewalld[664]: ERROR: INVALID_SERVICE: 'elasticsearch' not among existing services
Jun 21 09:56:04 systemd: Starting Elasticsearch...
Jun 21 09:56:08 systemd-entrypoint: Failed to load native library:jansi-2.4.0-d36ddbfd9a289759-libjansi.so.The native library file at /tmp/elasticsearch-7647277685344731393/jansi-2.4.0-d36ddbfd9a289759-libjansi.so is not executable, make sure that the directory is mounted on a partition without the noexec flag, or set the jansi.tmpdir system property to point to a proper location. osinfo: Linux/x86_64
Jun 21 09:56:08 systemd-entrypoint: java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-7647277685344731393/jansi-2.4.0-d36ddbfd9a289759-libjansi.so: /tmp/elasticsearch-7647277685344731393/jansi-2.4.0-d36ddbfd9a289759-libjansi.so: failed to map segment from shared object: Operation not permitted
Jun 21 09:56:31 systemd-entrypoint: ERROR: Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/elasticsearch.log
Jun 21 09:56:32 systemd-entrypoint: ERROR: Elasticsearch exited unexpectedly
Jun 21 09:56:32 systemd: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Jun 21 09:56:32 systemd: Failed to start Elasticsearch.
Jun 21 09:56:32 systemd: Unit elasticsearch.service entered failed state.
Jun 21 09:56:32 systemd: elasticsearch.service failed.

```

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [June 21, 2023, 2:19pm UTC](https://discuss.elastic.co/t/elasticsearch-code-exited-status-1-failure/336595/4 "2023-06-21T14:19:57Z")

</div>

O erro é esse aqui:

> Jun 21 09:37:49 systemd-entrypoint: Failed to load native library:jansi-2.4.0-bd276cefa76a63f8-libjansi.so.The native library file at /tmp/elasticsearch-9107953253587356133/jansi-2.4.0-bd276cefa76a63f8-libjansi.so is not executable, make sure that the directory is mounted on a partition without the noexec flag, or set the jansi.tmpdir system property to point to a proper location. osinfo: Linux/x86\_64

A partição do diretório `/tmp` tá montada como `noexec`, o diretório pros arquivos temporários que o Elasticsearch usa precisa permitir execução, isso tá explicado [nessa parte da documentação](https://www.elastic.co/guide/en/elasticsearch/reference/current/executable-jna-tmpdir.html).

Você precisa criar um outro diretório pra armazenar os arquivos temporários, dar permissão pro usuário `elasticsearch` ler e escrever nesse diretório e adicionar esse arquivo nas configurações do serviço do Elasticsearch como explicado na documentação.

Acho que seria algo mais ou menos assim:

```auto
$ cd /usr/share/elasticsearch
$ sudo mkdir tmp
$ sudo chown elasticsearch:elasticsearch tmp
$ sudo systemctl edit elasticsearch

```

Ai no editor que abre você cola isso

```auto
[Service]
Environment=ES_TMPDIR=/usr/share/elasticsearch/tmp

```

---

<div class="post-metadata">

### Author: ![codepan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/codepan/32/122632_2.png) [@codepan](https://discuss.elastic.co/u/codepan)
#### Post date: [June 21, 2023, 2:23pm UTC](https://discuss.elastic.co/t/elasticsearch-code-exited-status-1-failure/336595/5 "2023-06-21T14:23:24Z")

</div>

Show, muito obrigado!

---

<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: [July 19, 2023, 2:24pm UTC](https://discuss.elastic.co/t/elasticsearch-code-exited-status-1-failure/336595/6 "2023-07-19T14:24:20Z")

</div>

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