Elastisearch Start : java.nio.file.AccessDeniedException: /etc/elasticsearch/elasticsearch.keystore

Just now I am resinstalling ELk with this

If I would like to start Elasticsearch, I receives the follwing error:

Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]: java.nio.file.AccessDeniedException: /etc/elasticsearch/elasticsearch.keystore
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at java.base/sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:213)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at java.base/java.nio.channels.FileChannel.open(FileChannel.java:301)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at java.base/java.nio.channels.FileChannel.open(FileChannel.java:353)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at org.apache.lucene.store.NIOFSDirectory.openInput(NIOFSDirectory.java:78)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at org.apache.lucene.store.Directory.openChecksumInput(Directory.java:156)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at org.elasticsearch.common.settings.KeyStoreWrapper.load(KeyStoreWrapper.java:253)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at org.elasticsearch.server.cli.KeyStoreLoader.load(KeyStoreLoader.java:27)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at org.elasticsearch.server.cli.ServerCli.execute(ServerCli.java:87)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:55)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:101)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at org.elasticsearch.cli.Command.main(Command.java:54)
Aug 07 12:34:26 ESXELX1300 systemd-entrypoint[6090]:         at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:65)
Aug 07 12:34:26 ESXELX1300 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=74/IOERR

“Root” is owner on elasticsearch.keystore

Java is installed:

[root@ESXELX1300 lib]# java -version
Picked up JAVA_TOOL_OPTIONS: -Djavax.net.ssl.trustStore=/etc/javacas/cacerts
java version "21.0.8" 2025-07-15 LTS
Java(TM) SE Runtime Environment (build 21.0.8+12-LTS-250)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.8+12-LTS-250, mixed mode, sharing)

JAVA_HOME is set:

image

Do you have any idea, whet the problem can be?

EI

The problem is incorrect file ownership/permissions. On a RHEL-like (rpm) system you should have:

$ id elasticsearch
uid=986(elasticsearch) gid=987(elasticsearch) groups=987(elasticsearch)

$ sudo ls -l /etc/elasticsearch/elasticsearch.keystore
-rw-rw----. 1 root elasticsearch 536 Jul 14 09:24 /etc/elasticsearch/elasticsearch.keystore

i.e. an elasticsearch user and elasticsearch group, and that specific file should be group-owned by that elasticsearch group. Your file seems group-owned by “901” which likely means something went wrong or a step was missed. But you are following a (random) 3rd party (medium) guide. I’ve nothing against that guide’s author, but a quick glance and he starts by installing a JDK:

“We will need to install Java JDK version 21, the most recent version stable release, which is required by the ELK components.”

He does not appear to notice that the JDK that elasticsearch later uses in the one that came bundled with elasticsearch itself, not the one he installed. That's actually not that important, not relevant to your current issue, but does show the guide is at least a little suboptimal. I’m not motivated enough to spend further time on finding where his guide might be leading you astray.

IMHO you should use the official documentation. Especially if you are starting on your journey. If I were you, I'd start over, use a fresh VM, follow the official documentation. eg here