问题背景
在使用Docker启动elasticsearch的时候报错:
Exception in thread “main” SettingsException[Failed to load settings from /usr/share/elasticsearch/config/elasticsearch.yml]; nested: AccessDeniedException[/usr/share/elasticsearch/config/elasticsearch.yml];
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:416)
at java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:266)
at java.base/java.nio.file.Files.move(Files.java:1432)
at org.elasticsearch.xpack.security.cli.AutoConfigureNode.fullyWriteFile(AutoConfigureNode.java:1127)
at org.elasticsearch.xpack.security.cli.AutoConfigureNode.fullyWriteFile(AutoConfigureNode.java:1139)
at org.elasticsearch.xpack.security.cli.AutoConfigureNode.execute(AutoConfigureNode.java:687)
at org.elasticsearch.server.cli.ServerCli.autoConfigureSecurity(ServerCli.java:149)
at org.elasticsearch.server.cli.ServerCli.execute(ServerCli.java:87)
at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
at org.elasticsearch.cli.Command.main(Command.java:50)
at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)
因为elasticsearch没有启动,所以不能进入到容器中查看日志,可以使用docker查看,刷新打印:
docker logs elasticsearch
解决方案
添加自己创建的文件路径挂载的读写权限:
chmod -R 777 /mydata/elasticsearch
文章来源:https://www.toymoban.com/news/detail-595123.html
作为程序员第 201 篇文章,每次写一句歌词记录一下,看看人生有几首歌的时间,wahahaha …
文章来源地址https://www.toymoban.com/news/detail-595123.html
Lyric: 吃一口冰淇淋来融化你的伤心
到了这里,关于Docker启动elasticsearch退出并报错AccessDeniedException/usr/share/elasticsearch/config/elasticsearch.yml解决方案的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!