Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

This is the process for in-place upgrades of Elasticsearch (ES), using an existing Search feed and index data.

Info

Required

Upgrading Elasticsearch by script

On each node in an Elasticsearch cluster, follow this process and run the files from the Swarm download bundle:

...

  1. Compare the backup file to the newly created elasticsearch.yml and add back any customizations needed, such as node.attr.rack and systemctl restart elasticsearch if the configuration was modified.

Note

thread_pool.write.queue_size: 1000, xpack.ml.enabled, xpack.security.enabled, and prometheus.indices are no longer required.

...

Info

Important

Type Ctrl-C once when the upgrade script is stuck in retrying status checks and proceed to the next node after the script finishes if the cluster loses master during the upgrade process and does not recover. Review /etc/elasticsearch/elasticsearch.yml and tail -F /var/log/elasticsearch/<cluster-name>.log for configuration errors.

The nodes elect the master and recover once all nodes have started on Elasticsearch 7.5.2. Health status goes yellow, then eventually green. Re-enable shard allocation, otherwise /_cat/health?v stops at 50% with health status yellow.

Upgrading Elasticsearch

...

Manually

These are the steps the script automates if you need to upgrade manually:

  1. It fixes /etc/sysconfig/elasticsearch to the correct ES6 version (the same as ES7).

  2. It increases the systemd timeout in /etc/systemd/system/elasticsearch.service.d/override.conf (see github.com/elastic/elasticsearch/issues/60140)

  3. A prompt to continue with the yum upgrade to 7.5.2 appears after refreshing the config files for Elasticsearch 6.

  4. It disables shard allocation and does a POST synced-flush for safer rolling upgrades. 

    Info
    titleImportant

    Disabling shard allocation or sync-flush can fail to contact the node, but do not proceed to upgrade the next node until the cluster health is green again.

  5. It uninstalls the Prometheus Exporter plugin if it exists.

  6. It shells out to yum to install the Elasticsearch 7 RPM in the current directory or from artifacts.elastic.co, if unavailable.

  7. It updates elasticsearch.yml for version 7 compatibility, including discovery.initial_master_nodes instead of discovery.zen.unicast.hosts, and jvm.options.

  8. It starts the upgraded Elasticsearch 7 and waits for it to be ready.

  9. The cluster re-enables shard allocation and prompts to repeat these two steps on the next node if the cluster health is green or yellow.