记一次docker安装elasticsearch遇到的坑
Caused by: java.nio.file.FileSystemException: /usr/share/elasticsearch/plugins/plugin-descriptor.properties/plugin-descriptor.properties: Not a directory
·
标题docker-compose安装elasticsearch7.6.2
elasticsearch:
image: elasticsearch:7.6.2
container_name: elasticsearch
environment:
- "cluster.name=elasticsearch" #设置集群名称为elasticsearch
- "discovery.type=single-node" #以单一节点模式启动
- "ES_JAVA_OPTS=-Xms1024m -Xmx2048m" #设置使用jvm内存大小
volumes:
- /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins #插件文件挂载
- /mydata/elasticsearch/data:/usr/share/elasticsearch/data #数据文件挂载
ports:
- 9200:9200
- 9300:9300
解压elasticsearch7.6.2.zip到elasticsearch的plugins:
运行后报错信息:
"Caused by: java.nio.file.FileSystemException: /usr/share/elasticsearch/plugins/plugin-descriptor.properties/plugin-descriptor.properties: Not a directory",
2022-09-29T02:19:02.281696419Z "at sun.nio.fs.UnixException.translateToIOException(UnixException.java:100) ~[?:?]",
2022-09-29T02:19:02.281700082Z "at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]",
2022-09-29T02:19:02.281704374Z "at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) ~[?:?]",
2022-09-29T02:19:02.281707953Z "at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219) ~[?:?]",
2022-09-29T02:19:02.281711718Z "at java.nio.file.Files.newByteChannel(Files.java:374) ~[?:?]",
2022-09-29T02:19:02.281849382Z "at java.nio.file.Files.newByteChannel(Files.java:425) ~[?:?]",
2022-09-29T02:19:02.281854255Z "at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420) ~[?:?]",
2022-09-29T02:19:02.281858063Z "at java.nio.file.Files.newInputStream(Files.java:159) ~[?:?]",
2022-09-29T02:19:02.281861816Z "at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:156) ~[elasticsearch-7.6.2.jar:7.6.2]",
2022-09-29T02:19:02.281865692Z "at org.elasticsearch.plugins.PluginsService.readPluginBundle(PluginsService.java:398) ~[elasticsearch-7.6.2.jar:7.6.2]",
2022-09-29T02:19:02.281869778Z "at org.elasticsearch.plugins.PluginsService.findBundles(PluginsService.java:386) ~[elasticsearch-7.6.2.jar:7.6.2]",
2022-09-29T02:19:02.281873557Z "at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:379) ~[elasticsearch-7.6.2.jar:7.6.2]",
2022-09-29T02:19:02.281877281Z "at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:151) ~[elasticsearch-7.6.2.jar:7.6.2]",
2022-09-29T02:19:02.281881327Z "at org.elasticsearch.node.Node.<init>(Node.java:313) ~[elasticsearch-7.6.2.jar:7.6.2]",
2022-09-29T02:19:02.281884985Z "at org.elasticsearch.node.Node.<init>(Node.java:257) ~[elasticsearch-7.6.2.jar:7.6.2]",
2022-09-29T02:19:02.281888794Z "at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:221) ~[elasticsearch-7.6.2.jar:7.6.2]",
2022-09-29T02:19:02.281894994Z "at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221) ~[elasticsearch-7.6.2.jar:7.6.2]",
2022-09-29T02:19:02.281899251Z "at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) ~[elasticsearch-7.6.2.jar:7.6.2]",
2022-09-29T02:19:02.281910891Z "at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.6.2.jar:7.6.2]",
2022-09-29T02:19:02.281915302Z "... 6 more"] }
2022-09-29T02:19:02.281945084Z uncaught exception in thread [main]
2022-09-29T02:19:02.282913333Z java.lang.IllegalStateException: Could not load plugin descriptor for plugin directory [plugin-descriptor.properties]
2022-09-29T02:19:02.282928099Z Likely root cause: java.nio.file.FileSystemException: /usr/share/elasticsearch/plugins/plugin-descriptor.properties/plugin-descriptor.properties: Not a directory
2022-09-29T02:19:02.282932841Z at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
2022-09-29T02:19:02.282937266Z at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
2022-09-29T02:19:02.282941151Z at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
2022-09-29T02:19:02.282945124Z at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
2022-09-29T02:19:02.282948932Z at java.base/java.nio.file.Files.newByteChannel(Files.java:374)
2022-09-29T02:19:02.282957932Z at java.base/java.nio.file.Files.newByteChannel(Files.java:425)
2022-09-29T02:19:02.282962120Z at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
2022-09-29T02:19:02.282965939Z at java.base/java.nio.file.Files.newInputStream(Files.java:159)
2022-09-29T02:19:02.282969392Z at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:156)
2022-09-29T02:19:02.282973161Z at org.elasticsearch.plugins.PluginsService.readPluginBundle(PluginsService.java:398)
2022-09-29T02:19:02.282977133Z at org.elasticsearch.plugins.PluginsService.findBundles(PluginsService.java:386)
2022-09-29T02:19:02.282980790Z at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:379)
2022-09-29T02:19:02.282984582Z at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:151)
2022-09-29T02:19:02.282988790Z at org.elasticsearch.node.Node.<init>(Node.java:313)
2022-09-29T02:19:02.282992662Z at org.elasticsearch.node.Node.<init>(Node.java:257)
2022-09-29T02:19:02.282996491Z at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:221)
2022-09-29T02:19:02.283000224Z at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221)
2022-09-29T02:19:02.283057764Z at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349)
2022-09-29T02:19:02.283061678Z at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
2022-09-29T02:19:02.283065556Z at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
2022-09-29T02:19:02.283069375Z at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
2022-09-29T02:19:02.283073107Z at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125)
2022-09-29T02:19:02.283085699Z at org.elasticsearch.cli.Command.main(Command.java:90)
2022-09-29T02:19:02.283090718Z at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
2022-09-29T02:19:02.283094226Z at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
2022-09-29T02:19:02.283097934Z For complete error details, refer to the log at /usr/share/elasticsearch/logs/elasticsearch.log
既然报这个错,就查看这个文件
Caused by: java.nio.file.FileSystemException: /usr/share/elasticsearch/plugins/plugin-descriptor.properties/plugin-descriptor.properties: Not a directory
解决方法:在plugins中新建文件件,名字为analysis-ik,将所有plugins下的elasticsearch文件移动到analysis-ik下面,再次运行docker restart elasticsearch
成功!
更多推荐
已为社区贡献1条内容
所有评论(0)