Elasticsearch code=exited, status=1/FAILURE

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

systemctl status elasticsearch

● 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

        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) ~[?:?]

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.

Olá, obrigado!

/var/log/messages

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.

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.

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:

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

Ai no editor que abre você cola isso

[Service]
Environment=ES_TMPDIR=/usr/share/elasticsearch/tmp
1 Like

Show, muito obrigado!

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