How to properly upgrade plugins when upgrading Elasticsearch?

Hi,

I've recently upgraded a single Elasticsearch node from 5.6.2 to 5.6.3 and it refused to start because the "analysis-phonetic" plugin also needed to be upgraded.

I maintain my system up-to-date with Debian repositories, so Elasticsearch is upgraded whenever I "apt upgrade". Since I manage many servers, I have a few scripts to help automate this.

There I' ve found out that I also need to be aware of mandatory plugin upgrades and I'm looking for a better automation.

I can easily make a script to automatically remove/install every already installed plugin, then restart Elasticsearch, but something more fine-grained would be better. Like restarting Elasticsearch only if a "blocking" plugin is upgraded.

Is there an already established "good practice" for this?

Thanks you

Here is a very basic shell script for a very naive upgrade workflow :

#!/bin/bash

set -e
set -u

PLUGIN_BIN=/usr/share/elasticsearch/bin/elasticsearch-plugin
NEED_RESTART=""

for plugin in $(${PLUGIN_BIN} list); do
    "${PLUGIN_BIN}" remove "${plugin}"
    "${PLUGIN_BIN}" install "${plugin}"
    NEED_RESTART="1"
done

if [ -n "${NEED_RESTART}" ]; then
    systemctl restart elasticsearch
fi

exit 0

I can easily make a script to automatically remove/install every already installed plugin, then restart Elasticsearch

I think that's the right thing to do indeed.
It's somewhat is documented here: Rolling upgrade | Elasticsearch Guide [8.11] | Elastic

Are you looking for something else?

Thanks for the confirmation. I understand that there is nothing available to detect if plugins need to be upgraded or not, if they will block ES startup or not.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.