Skip to main content
Version: 6.11.0

Upgrading Elasticsearch to 8

info

If you have Elasticsearch 7.16 or an earlier version installed, you must first upgrade to 7.17 before you can proceed with an upgrade to 8. Please refer to Elasticsearch’s documentation for further information.

warning

If first upgrading to 7.17, it is important that you manually start Elasticsearch to complete the upgrade process.

This Elasticsearch upgrade guide assumes the service was installed as per the Installation Guide using the relevant Linux package manager.

  1. Stop the existing Elasticsearch service:

    sudo systemctl stop elasticsearch
  2. If you are using RHEL (Red Hat Enterprise Linux), backup elasticsearch.yml:

    sudo cp /etc/elasticsearch/elasticsearch.yml /tmp/elasticsearch-backup.yml
  3. If upgrading from any version of Elasticsearch, the existing service must be removed:

    Check if any version is currently installed:

    • For CentOS / RHEL:
    rpm -q elasticsearch
    • For Ubuntu:
    dpkg-query -l | grep elasticsearch
  4. If the commands above find an Elasticsearch version, then that version must be removed:

    • For CentOS: (This step will NOT remove data or configuration associated with the service)
    sudo rpm -e elasticsearch
    • For Ubuntu: (This step will NOT remove data or configuration associated with the service)
    sudo dpkg --remove elasticsearch
  5. Download and install Elasticsearch 8.8.2:

    For CentOS / RHEL: Download the package:

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.8.2-x86_64.rpm

    Download the checksum file:

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.8.2-x86_64.rpm.sha512

    Verify the downloaded package using the checksum:

    sha512sum -c elasticsearch-8.8.2-x86_64.rpm.sha512

    Install the new Elasticsearch package:

    sudo rpm -i elasticsearch-8.8.2-x86_64.rpm

    For Ubuntu: Download the package:

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.8.2-amd64.deb

    Download the checksum file:

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.8.2-amd64.deb.sha512

    Verify the downloaded package using the checksum:

    shasum -a 512 -c elasticsearch-8.8.2-amd64.deb.sha512

    Install the new Elasticsearch package:

    sudo dpkg -i elasticsearch-8.8.2-amd64.deb
  6. If you are using RHEL, restore your backed up copy of elasticsearch.yml:

    sudo cp /tmp/elasticsearch-backup.yml /etc/elasticsearch/elasticsearch.yml
  7. Reload the daemon, to ensure the new service script is loaded:

    sudo systemctl daemon-reload
  8. To start automatically when the system reboots, run:

    sudo systemctl enable elasticsearch
  9. If you are using the readonlyrest plugin: You must patch the elasticsearch before starting the elasticsearch service. Please refer to the Patch Elasticsearch section in Securing Elasticsearch

  10. Ensure the below property is set in the Elasticsearch configuration file:(/etc/elasticsearch/elasticsearch.yml):

    xpack.security.enabled: false
  11. Follow the steps in the “Securing Elasticsearch” section of the “Production Configuration“ page within the Installation Guide for installing the readonlyrest plugin. The previous readonlyrest configuration will still be in place.

  12. Finally the new service can be started:

    sudo systemctl start elasticsearch
Done

Elasticsearch has been successfully upgraded.