更改path.data后的Elasticsearch,无法访问'default.path.data'

时间:2017-10-21 05:02:50

标签: elasticsearch

我想将path.data更改为其他路径,并且我已经在elasticsearch中有一些数据。

我关注How to move elasticsearch data directory?并重新启动elasticsearch,发生了错误。

我的弹性搜索版本是elasticsearch-5.6.1。 这是我的登录/ var / log / elasticsearch

  

java.lang.IllegalStateException:无法访问'default.path.data'(/ var / lib / elasticsearch)       在org.elasticsearch.bootstrap.Security.addPath(Security.java:444)〜[elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:322)〜[elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.bootstrap.Security.createPermissions(Security.java:240)〜[elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.bootstrap.Security.configure(Security.java:118)~ [elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:228)〜[elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342)[elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132)[elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123)[elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67)[elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134)[elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.cli.Command.main(Command.java:90)[elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91)[elasticsearch-5.6.1.jar:5.6.1]       在org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84)[elasticsearch-5.6.1.jar:5.6.1]   引起:java.nio.file.AccessDeniedException:/ var / lib / elasticsearch       at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)〜[?:1.8.0_131]       在sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)〜[?:1.8.0_131]       at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)〜[?:1.8.0_131]       at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)〜[?:1.8.0_131]       在java.nio.file.Files.createDirectory(Files.java:674)〜[?:1.8.0_131]

在深入研究之后,我找到了https://github.com/elastic/elasticsearch/issues/25265

我想知道有解决此问题的解决方法吗?或者我需要等待6.0.0版本?

1 个答案:

答案 0 :(得分:2)

在深入研究之后,我找到了answer

  

删除" -Edefault.path.data = $ {DATA_DIR}"启动命令中的参数,一切正常。

我的环境是Ubuntu 16.04并从RPM / DEB安装ES。

/etc/init.d/elasticsearch中启动命令的路径,我也改变/usr/lib/systemd/system/elasticsearch.service然后重新启动服务。问题解决了。

顺便说一下,如果我还面临路径数据的权限问题。要通过

解决它
sudo chown -R elasticsearch:elasticsearch /your/data/path

希望这些有用!