Elasticsearch is not starting - AccessDeniedException

Dear All,

I have installed ES v7.6.2 using rpm file. I have used following command to install and ES was installed successfully without giving an error.

rpm -i elasticsearch-7.6.2-x86_64.rpm

Before installing ES i had installed JAVA using following command.

yum install java-1.8.0-openjdk.x86_64

When I check the JAVA version, it gives the correct installed version as below.

openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

But the problem is when I try to run the ES service it is not coming up and following error is logged in the logs.

Apr 14 03:05:41 localhost systemd: Starting Elasticsearch...
Apr 14 03:05:43 localhost elasticsearch: OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a futur
e release.
Apr 14 03:05:49 localhost elasticsearch: Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.AccessDeniedException: /var/run/elasti
csearch
Apr 14 03:05:49 localhost elasticsearch: Likely root cause: java.nio.file.AccessDeniedException: /var/run/elasticsearch
Apr 14 03:05:49 localhost elasticsearch: at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
Apr 14 03:05:49 localhost elasticsearch: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
Apr 14 03:05:49 localhost elasticsearch: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
Apr 14 03:05:49 localhost elasticsearch: at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:389)
Apr 14 03:05:49 localhost elasticsearch: at java.base/java.nio.file.Files.createDirectory(Files.java:693)
Apr 14 03:05:49 localhost elasticsearch: at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:800)
Apr 14 03:05:49 localhost elasticsearch: at java.base/java.nio.file.Files.createDirectories(Files.java:786)
Apr 14 03:05:49 localhost elasticsearch: at org.elasticsearch.common.PidFile.create(PidFile.java:69)
Apr 14 03:05:49 localhost elasticsearch: at org.elasticsearch.common.PidFile.create(PidFile.java:55)
Apr 14 03:05:49 localhost elasticsearch: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:324)
Apr 14 03:05:49 localhost elasticsearch: at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
Apr 14 03:05:49 localhost elasticsearch: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
Apr 14 03:05:49 localhost elasticsearch: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
Apr 14 03:05:49 localhost elasticsearch: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125)
Apr 14 03:05:49 localhost elasticsearch: at org.elasticsearch.cli.Command.main(Command.java:90)
Apr 14 03:05:49 localhost elasticsearch: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
Apr 14 03:05:49 localhost elasticsearch: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
Apr 14 03:05:49 localhost elasticsearch: For complete error details, refer to the log at /var/log/elasticsearch/elasticsearch.log
Apr 14 03:05:49 localhost systemd: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Apr 14 03:05:49 localhost systemd: Failed to start Elasticsearch.
Apr 14 03:05:49 localhost systemd: Unit elasticsearch.service entered failed state.
Apr 14 03:10:13 localhost systemd: Starting Cleanup of Temporary Directories...
Apr 14 03:10:13 localhost systemd: Started Cleanup of Temporary Directories.

When i went through the log file I identified that the error was because of permission issue with a file.
Apr 14 03:05:49 localhost elasticsearch: Exception in thread "main"org.elasticsearch.bootstrap.BootstrapException:java.nio.file.AccessDeniedExceptin: /var/run/elasticsearch

But when i checked on the above mentioned file, there was no file with that name in the mentioned directory.

Please help me to solve this error and I had configured ES v6.5 using the same method and it is running without any issue.

Thanks in advance
Billz26

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