Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Document modified as per SWAR-9159.

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

...

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

  1. Query the running Elasticsearch cluster, before upgrading, Install the latest caringo-elasticsearch-search-VERSION.noarch.rpm with yum install.

  2. Before upgrading, query the Elasticsearch cluster for the list of nodes.

    Code Block
    languagebash
    curl -i http://ELASTICSEARCH:9200/_cat/nodes

    Note which node is starred . That and that is the Elasticsearch master node which is recommended to upgrade last to avoid problems electing a new one.

  3. Backup the existing elasticsearch.yml, so a record of any customizations made exists.

  4. Create a symbolic (soft) link: symlink /var/lib/elasticsearch if path.data is customized . Perform the upgrade manually, as described below if unable. Back up the current configuration with any /etc/elasticsearch/elasticsearch.yml customizations such as node.attr.rack and run /root/dist/indexer-grab.sh and gather stats for support.

  5. Start by installing the latest Swarm Search, which is the caringo-elasticsearch-search RPM when upgrading Elasticsearch 6.

    Code Block
    languagebash
    yum install caringo-elasticsearch-search-VERSION.noarch.rpm
    Info
    titleTip

    The error: "ES_PATH_CONF must be set to the configuration path chown: cannot access '/etc/elasticsearch/elasticsearch.keystore': No such file or directory" displays if Elasticsearch 7 RPM is inadvertently installed. Install caringo-elasticsearch-search-7.0.0 RPM to proceed.

  6. Run the script that installs and configures the upgrade.
    The script detects Elasticsearch 6 is installed and discovery.zen.unicast.hosts is configured, so it runs as with --upgrade instead of configuring a new cluster.

    Code Block
    languagebash
    /usr/share/caringo-elasticsearch-search/bin/configure_elasticsearch_with_swarm_search.py
  7. Compare the backup file to the newly created elasticsearch.yml and add back any customizations needed, such as network.host (which defaults to _site_, all interfaces).

  8. Verify all nodes are accounted for, all shards are assigned, and the status is green.

    Code Block
    languagebash
    curl -i 'http://ELASTICSEARCH:9200/_cat/health?v'

...

  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.

    Warning

    Internet access is expected for the upgrade. Verify the Elasticsearch RPM is in the current directory if access is 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.