Versions Compared

Key

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

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

...

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

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

    Example output:
    [root@elasticsearch Elasticsearch]# curl -i http://<ip-address>:9200/_cat/nodes

    Note which node is starred; that
    HTTP/1.1 200 OK
    content-type: text/plain; charset=UTF-8
    content-length: 300

    <ip-node1> 14 99 1 0.02 0.14 0.15 dilm - <hostname-node1>
    <ip-node2>  1 71 1 0.01 0.09 0.08 dilm - <hostname-node2>
    <ip-node3> 72 99 0 0.08 0.06 0.08 dilm - <hostname-node3>
    <ip-node4> 50 99 0 0.03 0.04 0.05 dilm * <hostname-node4>
    <ip-node5> 47 99 1 0.08 0.14 0.22 dilm - <hostname-node5>
    x

    The node with the * is the Elasticsearch master node, which . It is recommended to upgrade the node last to avoid problems electing a new onemaster node.

  2. Backup the existing elasticsearch.yml, so a record exists of any customizations made exists. Run /root/dist/indexer-grab.sh and gather stats for DataCore support.

  3. Start by installing the latest Swarm Search, which is the caringo-elasticsearch-search RPM.

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

...

  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.