启动错误信息如下:
2023-12-27 14:49:31 {"type": "server", "timestamp": "2023-12-27T06:49:31,007Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "898cab85d2dd", "message": "closed", "cluster.uuid": "dY9Q1WP6QSqMvs5wig_hyg", "node.id": "HtVsLE2QRXmPJMS13D6ztQ" }
2023-12-27 14:49:33 Exception in thread "main" java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/ik
2023-12-27 14:49:33 at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
2023-12-27 14:49:33 at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
2023-12-27 14:49:33 at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
2023-12-27 14:49:33 at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:439)
2023-12-27 14:49:33 at java.base/java.nio.file.Files.newDirectoryStream(Files.java:476)
2023-12-27 14:49:33 at java.base/java.nio.file.Files.list(Files.java:3765)
2023-12-27 14:49:33 at org.elasticsearch.tools.launchers.BootstrapJvmOptions.getPluginInfo(BootstrapJvmOptions.java:49)
2023-12-27 14:49:33 at org.elasticsearch.tools.launchers.BootstrapJvmOptions.bootstrapJvmOptions(BootstrapJvmOptions.java:34)
2023-12-27 14:49:33 at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:137)
2023-12-27 14:49:33 at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:86)
问题原因:plugins中添加的ik目录没有权限;文章来源:https://www.toymoban.com/news/detail-775397.html
解决方案:进入elasticsearch容器对应plugins目录下,进行 chmod 777 ik 授权即可。文章来源地址https://www.toymoban.com/news/detail-775397.html
ZengJun@ZJUN-MACPRO Downloads % docker cp ik elasticsearch:/usr/share/elasticsearch/plugins
Successfully copied 9.89MB to elasticsearch:/usr/share/elasticsearch/plugins
ZengJun@ZJUN-MACPRO Downloads % docker exec -it elasticsearch /bin/bash
[root@92ef39f76655 elasticsearch]# cd /usr/share/elasticsearch/plugins
[root@92ef39f76655 plugins]# ls -l
total 4
drwx------ 3 502 games 4096 Dec 27 06:46 ik
[root@92ef39f76655 plugins]# chmod 777 ik
[root@92ef39f76655 plugins]# ls -l
total 4
drwxrwxrwx 3 502 games 4096 Dec 27 06:46 ik
[root@92ef39f76655 plugins]# exit
exit
ZengJun@ZJUN-MACPRO Downloads % docker restart elasticsearch
elasticsearch
到了这里,关于elasticsearch安装中文分词IK启动异常:java.nio.file.AccessDeniedException的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!