如何在Docker上安装用于elasticsearch的xpack?

问题描述:

我想在ELK-Stack上安装xpack。 我会用3个Dockerfiles来做到这一点。这时我Dockerfile是这样的:如何在Docker上安装用于elasticsearch的xpack?

# Orginal Image von elasticsearch laden 
FROM docker.marksys.de/elasticsearch:latest 
USER root 

ADD ./x-pack-5.5.2.zip /usr/share/elasticsearch/plugins 

RUN bin/elasticsearch-plugin install file:///usr/share/elasticsearch/plugins/x-pack-5.5.2.zip/ 
RUN elasticsearch 

每一次,当我建立Dockerfile到的图像,构建过程止于此:

Exception in thread "main" java.lang.IllegalStateException: Could not load plugin descriptor for existing plugin [x-pack-5.5.2.zip]. Was the plugin built before 2.0? 
    at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:334) 
    at org.elasticsearch.plugins.InstallPluginCommand.jarHellCheck(InstallPluginCommand.java:518) 
    at org.elasticsearch.plugins.InstallPluginCommand.verify(InstallPluginCommand.java:500) 
    at org.elasticsearch.plugins.InstallPluginCommand.install(InstallPluginCommand.java:543) 
    at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:217) 
    at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:201) 
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) 
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) 
    at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:69) 
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) 
    at org.elasticsearch.cli.Command.main(Command.java:88) 
    at org.elasticsearch.plugins.PluginCli.main(PluginCli.java:47) 
Caused by: java.nio.file.FileSystemException: /usr/share/elasticsearch/plugins/x-pack-5.5.2.zip/plugin-descriptor.properties: Not a directory 
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91) 
    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 java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384) 
    at java.nio.file.Files.newInputStream(Files.java:152) 
    at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:114) 
    at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:331) 
    ... 11 more 

我觉得安装过程不能找到/x-pack-5.5.2.zip/plugin-descriptor.properties文件。

的ZIP结构是这样的:

x-pack-5.5.2.zip

  • elasticsearch -content
  • Kibana -content
  • logstash - content

有人知道一个很好的教程吗?

我解决了这个问题:

在我的问题上面你可以看到我的zip添加到/ usr /共享/ elasticsearch /插件。问题在于,弹性。无法从该目录打开该zip文件。

我的解决方案:将zip添加到新的或其他目录中,然后再次开始构建过程。在我的情况下,我在/ usr/share/elasticsearch中添加了zip。

问候TheLegend31

我想这应该安装xpack插件

RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install x-pack 

xpack需要许可证,基本许可证是免费

+0

我试过这个,我得到了相同的堆栈跟踪。我从本地ZIP安装xpack,因为我们的代理在我的公司很棘手.. 我从我们自己的docker仓库获取来自elasticsearch的“latest”版本,最新版本的ES是5.5.2。 – TheLegend31

+0

我想因为xpack有许可证,它会尝试连接elasctic –

+0

,但他们在他们的网站上有一个关于此的教程,其中描述了使用本地ZIP的安装: https://www.elastic.co/guide/en /elasticsearch/reference/5.6/installing-xpack-es.html – TheLegend31

弹性的官方泊坞的图像已经包含了X-包在5.x中只需从https://www.docker.elastic.co中选择正确的图像即可。

+0

感谢您的回答。我的docker-deamon在代理之后,我不能直接从集线器下载图像。我们有我们自己的存储库,并没有最新的图像。但是,谢谢你的回答!我会保持这一点。 – TheLegend31