When path.data is changed, elasticsearch is not starting


(rajesh) #1

Hi, I have installed elasticsearch on Linux-Redhat distribution using RPM package. It runs normally until I change path.data in elasticsearch.yml. I set path.data to /opt/elk/es/data and it started failing with the below error

java.lang.IllegalStateException: Failed to create node environment
at org.elasticsearch.node.Node.(Node.java:267) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.node.Node.(Node.java:244) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:232) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:232) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:351) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.cli.Command.main(Command.java:88) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.5.1.jar:5.5.1]
Caused by: java.nio.file.AccessDeniedException: /opt/elk/es/data/nodes
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:?]
at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_144]
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_144]
at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_144]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:221) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.node.Node.(Node.java:264) ~[elasticsearch-5.5.1.jar:5.5.1]

Can you please help me resolve this issue..


(Paul McMahon) #2

Looks like elasticsearch doesn't have the access it needs to the data path.

Assuming you are running it as a user called 'elasticsearch', you'll probably need to do something like:

sudo chown elasticsearch /opt/elk/es/data


(rajesh) #3

Hi Paul,

Thanks for your quick reply! I already did that but it's still showing the same exception.


(rajesh) #4

I was using my account as owner and so it was failing. Since I am running as a service I have to use 'elasticsearch' user. It fixed my problem.

Thanks Paul for your help :slight_smile:


(system) #5

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