Unable to start Elasticserach in Ubuntu 18.04

Asked by chinkleet shukla on 2021-03-25

I have installed Elasticsearch- 7.11.2 in Ubuntu 18.04 machine.
when trying to start the Elasticsearch service getting below error:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

root@extramarks-Latitude-3400:/etc/elasticsearch# systemctl status elasticsearch.service
Display all 571 possibilities? (y or n)
root@extramarks-Latitude-3400:/etc/elasticsearch# systemctl status elasticsearch.service
‚óŹ elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: https://www.elastic.co
root@extramarks-Latitude-3400:/etc/elasticsearch# systemctl start elasticsearch.service

Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.
root@extramarks-Latitude-3400:/etc/elasticsearch#
root@extramarks-Latitude-3400:/etc/elasticsearch#
root@extramarks-Latitude-3400:/etc/elasticsearch#
root@extramarks-Latitude-3400:/etc/elasticsearch# journalctl -xe
Mar 25 11:44:19 extramarks-Latitude-3400 /usr/lib/gdm3/gdm-x-session[3423]: (II) event17 - DELL08BC:00 04F3:30CA Touchpad: SYN_DROPPED event -
Mar 25 11:44:19 extramarks-Latitude-3400 /usr/lib/gdm3/gdm-x-session[3423]: (EE) client bug: timer event17 tap: offset negative (-881ms)
Mar 25 11:45:01 extramarks-Latitude-3400 systemd-entrypoint[15473]: Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException:
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: Likely root cause: java.nio.file.AccessDeniedException: /etc/elasticsearch
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at java.base/sun.nio.fs.UnixException.translateToIOException(UnixE
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixExc
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixExc
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(Unix
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at java.base/java.nio.file.Files.newOutputStream(Files.java:224)
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDire
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDire
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.apache.lucene.store.FSDirectory.createOutput(FSDirectory.ja
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.elasticsearch.common.settings.KeyStoreWrapper.save(KeyStore
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.elasticsearch.bootstrap.Bootstrap.loadSecureSettings(Bootst
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.elasticsearch.bootstrap.Bootstrap.loadSecureSettings(Bootst
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342)
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.ja
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(Environme
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.elasticsearch.cli.Command.main(Command.java:79)
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.ja
Mar 25 11:45:02 extramarks-Latitude-3400 systemd-entrypoint[15473]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.ja
Mar 25 11:45:01 extramarks-Latitude-3400 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Mar 25 11:45:02 extramarks-Latitude-3400 CRON[15692]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 25 11:45:01 extramarks-Latitude-3400 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Mar 25 11:45:02 extramarks-Latitude-3400 CRON[15695]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Mar 25 11:45:01 extramarks-Latitude-3400 systemd[1]: Failed to start Elasticsearch.
-- Subject: Unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit elasticsearch.service has failed.
--
-- The result is RESULT.
Mar 25 11:45:03 extramarks-Latitude-3400 CRON[15692]: pam_unix(cron:session): session closed for user root
root@extramarks-Latitude-3400:/etc/elasticsearch#
root@extramarks-Latitude-3400:/etc/elasticsearch# exit
logout
(base) extramarks@extramarks-Latitude-3400:~$
(base) extramarks@extramarks-Latitude-3400:~$ sudo systemctl start elasticsearch.service
Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.

Please find below my system information:

(base) extramarks@extramarks-Latitude-3400:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

------------------------------------------------------------------------------------------------------------------------------

(base) extramarks@extramarks-Latitude-3400:~$ uname -a
Linux extramarks-Latitude-3400 5.4.0-70-generic #78~18.04.1-Ubuntu SMP Sat Mar 20 14:10:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

KIndly help me with this.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

How did you install elasticsearch 7.11.2 in Ubuntu 18.04?
Such version is not available from the Ubuntu repositories, but only on foreign sources.

From the log:
Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException:
Likely root cause: java.nio.file.AccessDeniedException: /etc/elasticsearch

This looks as if something is wrong with the setup of elasticsearch and its dependencies.
You probably better ask at https://discuss.elastic.co/

Remark: A new version 7.12.0 available on elastic.co

Can you help with this problem?

Provide an answer of your own, or ask chinkleet shukla for more information if necessary.

To post a message you must log in.