简体   繁体   English

更新elasticsearch插件

[英]Update of elasticsearch plugin

I have developed a couple of plugins for elasticsearch, and these may require (more or less) frequent updates. 我为elasticsearch开发了一些插件,这些插件可能需要(或多或少)频繁更新。 My simple question is: is there a way of updating an elasticsearch plugin without having to remove the old version, delete the relevant indexes, install the new version and rebuild the indexes from scratch? 我的简单问题是:有没有办法更新elasticsearch插件而不必删除旧版本,删除相关索引,安装新版本并从头开始重建索引?

Thanks in advance. 提前致谢。

There is no way to update an existing plugin. 无法更新现有插件。 You need to delete the old version and install the new one. 您需要删除旧版本并安装新版本。

I didn't get your question about indices though. 我没有得到关于指数的问题。 A plugin doesn't necessarily work against data, it can just be a site plugin, a query parser etc. In case a plugin does work against indices and you want to upgrade it, but the elasticsearch version stays the same, I don't see why you would need to reindex. 插件不一定对数据起作用,它可以只是一个站点插件,一个查询解析器等。如果一个插件确实对索引起作用并且你想升级它,但是弹性搜索版本保持不变,我不会看看为什么你需要重新索引。 The only case is if the plugin itself changed in a non backwards compatible way. 唯一的情况是插件本身是以非向后兼容的方式改变的。

As of the latest version 2.4.1 (2016-10-18) there is still no way to do this easily, because the elasticsearch folks recommend manual plugin updates . 从最新版本2.4.1(2016-10-18)开始,仍然无法轻松完成此操作,因为elasticsearch人员建议手动插件更新

Expect that when you update Elasticsearch and start the service, that you will end up with an error because service won't start due to a plugin being one minor version behind the ES version, eg "license". 预计当您更新Elasticsearch并启动服务时,您将最终收到错误,因为插件是ES版本背后的一个次要版本,例如“许可证”,因此无法启动服务。

Go to your elasticsearch bin directory and run the following commands: 转到elasticsearch bin目录并运行以下命令:

sudo ./plugin remove <plugin name>
sudo ./plugin install <plugin name>

You could even be so bold as to write an "update" shell script that does this for you. 您甚至可以大胆地编写一个“更新”shell脚本来为您执行此操作。

A bash script here: 这里有一个bash脚本:

#!/bin/bash

plugin_bin=/usr/share/elasticsearch/bin/plugin
for plugin in $($plugin_bin list | awk '/^\s*-\s*(\S+)/{print $2}')
do
    $plugin_bin remove $plugin && $plugin_bin install $plugin
done

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM