首页 > 数据库技术 > 详细

Docker Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/ik-analyzer/plugin-descriptor.properties

时间:2020-03-02 19:01:58      阅读:390      评论:0      收藏:0      [点我收藏+]

在使用Docker安装Elasticsearch的IK-Analyzer中文分词器时出现以下错误

错误信息:Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/ik-analyzer/plugin-descriptor.properties

错误原因:在拷贝IK-analzyer中文分词器插件到elasticsearch中后,重启Docker容器报以下错误:

Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/ik-analyzer/plugin-descriptor.properties
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:1.8.0_181]
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:1.8.0_181]
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:1.8.0_181]
    at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[?:1.8.0_181]
    at java.nio.file.Files.newByteChannel(Files.java:361) ~[?:1.8.0_181]
    at java.nio.file.Files.newByteChannel(Files.java:407) ~[?:1.8.0_181]
    at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384) ~[?:1.8.0_181]
    at java.nio.file.Files.newInputStream(Files.java:152) ~[?:1.8.0_181]
    at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:114) ~[elasticsearch-5.6.12.jar:5.6.12]
    at org.elasticsearch.bootstrap.Spawner.spawnNativePluginControllers(Spawner.java:80) ~[elasticsearch-5.6.12.jar:5.6.12]
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:168) ~[elasticsearch-5.6.12.jar:5.6.12]
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.12.jar:5.6.12]
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.12.jar:5.6.12]
    ... 6 more

 

原因:目标容器内目录权限不足

解决方法:可以先将宿主机插件目录赋予777权限,再进行复制

$ sudo chmod -R 777 /Users/yans/Downloads/ik-analyzer(插件目录)
$ sudo docker cp /Users/yans/Downloads/ik-analyzer 容器ID:/usr/share/elasticsearch/plugins/ik-analyzer

之后再启动容器

$ docker start 容器ID

 

Docker Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/ik-analyzer/plugin-descriptor.properties

原文:https://www.cnblogs.com/eanson/p/12396981.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!