提供新的data.path时,Elasticsearch会与AccessDeniedException崩溃

时间:2016-01-13 16:16:38

标签: elasticsearch

我更新了data.path中的elasticsearch.yml条目以指向新位置。但是,在尝试重新启动Elastic时,我现在收到以下错误:

Starting elasticsearch: Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.data' (/etc/lib/stuff)
Likely root cause: java.nio.file.AccessDeniedException: /etc/lib
        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)
        at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
        at java.nio.file.Files.createDirectories(Files.java:767)
        at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:250)
        at org.elasticsearch.bootstrap.Security.addPath(Security.java:227)
        at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:203)
        at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:184)
        at org.elasticsearch.bootstrap.Security.configure(Security.java:105)
        at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:196)
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)

为了调试,我尝试将data.path从默认的var/lib/elasticsearch移动到/var/lib/stuff

据我所知,用户,组和权限在这两个目录中匹配:

$ ls -l /var/lib/

drwxr-xr-x 3 elasticsearch elasticsearch 4096 Jan 11 10:50 elasticsearch
...
drwxr-xr-x 2 elasticsearch elasticsearch 4096 Jan 13 10:54 stuff
...

那么为什么Elastic会抛出AccessDenied例外?

如果我删除了我的自定义data.path,那么它会重新开始工作。我错过了什么吗?

0 个答案:

没有答案