Elasticsearch Upgarde (Ubuntu)

This article provides detailed instructions for upgrading Elasticsearch to the latest stable version on an Ubuntu system using the APT package manager. It ensures a smooth upgrade while preserving the existing configuration and data.

Prerequisites

  • User performing the upgrade has sudo (administrative) privileges.

  • Elasticsearch is already installed on the system.

  • Credentials for the elastic user are available (if security is enabled).

  • System has internet connectivity to fetch updated packages from the repository.

Upgrade Steps

  • Check the Current Version

    • Run the following command to verify the installed Elasticsearch version:

      curl -XGET -u elastic:<password> http://localhost:9200
    • Replace <password> with the actual password of the elastic user.

  • Stop the Elasticsearch Service

    • Prevent data corruption by stopping the service before upgrading:

      sudo systemctl stop elasticsearch
  • Upgrade Elasticsearch via APT

    • Update repositories and install the latest version:

      sudo apt update
      sudo apt install elasticsearch -y
    • This fetches the latest version from the configured Elastic APT repository.

  • Start the Elasticsearch Service

    • Restart the service after installation:

      sudo systemctl start elasticsearch
  • Verify the Upgrade

    • Confirm the installed version:

      curl -XGET -u elastic:<password> http://localhost:9200
    • The response should show the upgraded version number.

Post-Upgrade Verification (Optional)

  • Check Elasticsearch logs for warnings or errors:

    sudo journalctl -u elasticsearch
  • Confirm the updated version with the API:

    curl -XGET -u elastic:<password> http://localhost:9200

Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.

Last updated

Was this helpful?