How To Check Elasticsearch Version

If we’re running Elasticsearch, it’s important to know the version of the product we’re using for various reasons, such as checking for upgrades or ensuring compatibility with other components of the Elastic Stack. In this short article we will learn how to check Elasticsearch version installed on our system.

Before We Begin

Before we start checking the version of Elasticsearch used on our system, we have to make sure the Elasticsearch service is running normally. To ensure this, we can check it with the command line:

$ sudo systemctl status elasticsearch

Output :

ramans@infodiginet:~$ sudo systemctl status elasticsearch
[sudo] password for ramans: 
● elasticsearch.service - Elasticsearch
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor>
     Active: active (running) since Fri 2023-01-27 08:19:38 PST; 12s ago
       Docs: https://www.elastic.co
   Main PID: 983 (java)
      Tasks: 85 (limit: 4582)
     Memory: 2.2G
     CGroup: /system.slice/elasticsearch.service
             ├─ 983 /usr/share/elasticsearch/jdk/bin/java -Xms4m -Xmx64m -XX:+U>
             ├─1432 /usr/share/elasticsearch/jdk/bin/java -Des.networkaddress.c>
             └─1848 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x>

Jan 27 08:18:24 infodiginet systemd[1]: Starting Elasticsearch...
Jan 27 08:19:38 infodiginet systemd[1]: Started Elasticsearch.

Checking Elasticsearch Version

There are several ways to check the version of Elasticsearch running on your system, including:

  1. using Curl from Command Line
  2. elasticsearch –version

A more detailed explanation will be presented below.

1. Checking Elasticsearch version using curl command line

By using this option, we will submit following command line :

curl -XGET 'http://localhost:9200'

Outptu :

ramans@infodiginet:~$ curl -XGET 'http://localhost:9200'
{
  "name" : "infodiginet",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "KDhbln6KTiyXUKddJ6gWeg",
  "version" : {
    "number" : "8.5.1",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "c1310c45fc534583afe2c1c03046491efba2bba2",
    "build_date" : "2022-11-09T21:02:20.169855900Z",
    "build_snapshot" : false,
    "lucene_version" : "9.4.1",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

From the information above, we can know that the version of Elasticsearch installed on our system is: version 8.5.1.

2. Checking Elasticsearch version using elasticsearch –version

An other option to check Elasticsearch version is using command line :

/bin/elasticsearch --version

Output :

ramans@infodiginet:/usr/share/elasticsearch$ sudo bin/elasticsearch --version
Version: 8.5.1, Build: deb/c1310c45fc534583afe2c1c03046491efba2bba2/2022-11-09T21:02:20.169855900Z, JVM: 19.0.1
(Visited 198 times, 1 visits today)

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *