问题描述
提示:Linux中部署elasticsearch7.8.0
在处于非root权限下,启动elasticsearch,遇到了elasticsearch.keystore的问题
[es@localhost admin]$ /soft/elasticsearch-cluster/elasticsearch-7.8.0/bin/elasticsearch
future versions of Elasticsearch will require Java 11; your Java version from [/soft/jdk1.8.0_202/jre] does not meet this requirement
future versions of Elasticsearch will require Java 11; your Java version from [/soft/jdk1.8.0_202/jre] does not meet this requirement
Exception in thread "main" java.nio.file.AccessDeniedException: /soft/elasticsearch-cluster/elasticsearch-7.8.0/config/elasticsearch.keystore
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.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at org.apache.lucene.store.SimpleFSDirectory.openInput(SimpleFSDirectory.java:77)
at org.elasticsearch.common.settings.KeyStoreWrapper.load(KeyStoreWrapper.java:220)
at org.elasticsearch.common.settings.HasPasswordKeyStoreCommand.execute(HasPasswordKeyStoreCommand.java:42)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:91)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.common.settings.KeyStoreCli.main(KeyStoreCli.java:43)
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file logs/gc.log due to Permission denied
Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.AccessDeniedException: /soft/elasticsearch-cluster/elasticsearch-7.8.0/config/elasticsearch.keystore
Likely root cause: java.nio.file.AccessDeniedException: /soft/elasticsearch-cluster/elasticsearch-7.8.0/config/elasticsearch.keystore
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.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at org.apache.lucene.store.SimpleFSDirectory.openInput(SimpleFSDirectory.java:77)
at org.elasticsearch.common.settings.KeyStoreWrapper.load(KeyStoreWrapper.java:220)
at org.elasticsearch.bootstrap.Bootstrap.loadSecureSettings(Bootstrap.java:240)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
原因分析:
提示:在启动之前,已经给elasticsearch文件夹全部授权为非root权限可以访问,但是elasticsearch.keystore给文件是在启动之后生成的,默认启动权限为root所以无法继续访问下去。
解决方案:
提示:通过修改新生成文件的权限既可以重新启动。在修改权限过程中请使用root权限;如果该权限依然无法修改,请重启虚拟机之后在尝试文章来源:https://www.toymoban.com/news/detail-736773.html
#注意是在配置文件的目录下进行操作的
chown es:es ./elasticsearch.keystore
只针对这一个文件进行修改权限,修改之后如下:
然后尝试启动elasticsearch就行文章来源地址https://www.toymoban.com/news/detail-736773.html
到了这里,关于ES(elasticsearch)中遇到elasticsearch.keystore的问题,已解决!!!的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!