diff --git a/HowtoElasticsearch.md b/HowtoElasticsearch.md index 59b96e7f..543037e0 100644 --- a/HowtoElasticsearch.md +++ b/HowtoElasticsearch.md @@ -402,6 +402,29 @@ analysis-phonetic java.lang.IllegalArgumentException: plugin [analysis-phonetic] is incompatible with version [5.6.3]; was designed for version [5.6.2] ~~~ +On peut utiliser ce script pour automatiser la mise à jour de tous les plugins et le redémarrage d'Elasticsearch : + +~~~{.bash} +#!/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 +~~~ ## Principe de fonctionnement d'Elasticsearch