Elasticsearch Check Elasticsearch Version

By Opster Team

Updated: Jan 28, 2024

| 2 min read

Checking Elasticsearch Version

When working with Elasticsearch, it’s essential to know the version you’re using, as different versions may have different features, APIs, and configurations. In this article, we’ll discuss how to check the Elasticsearch version using various methods.

If you want to learn more about the concept of Elasticsearch version and what is it used for, check out this guide. To learn how to upgrade versions in Elasticsearch, read this guide.

Methods to check Elasticsearch version

Method 1: Using the REST API

You can check the Elasticsearch version by sending a GET request to the cluster’s root endpoint. Here’s an example using the `curl` command:

bash
curl -X GET "http://localhost:9200"

The response will include the version number:

`json
{
"name" : "node-1",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "abcd1234",
"version" : {
    "number" : "7.17.3",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "5ad023604c8d7416c9eb6c0eadb62b14e766caff",
    "build_date" : "2022-04-19T08:11:19.070913226Z",
    "build_snapshot" : false,
    "lucene_version" : "8.11.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"

},
"tagline" : "You Know, for Search"
}

In this example, the Elasticsearch version is `7.17.3`.

Method 2: Checking the Log Files

Elasticsearch logs the version number during startup. You can find the version in the log files, typically located in the `logs` directory within the Elasticsearch installation folder. Look for a line similar to the following:

[2023-04-22T22:00:00,000][INFO ][o.e.n.Node ] [node-1] version[7.17.3.0], pid[12345], build[default/tar/abcdef123456/2021-09-22T21:37:37.881534Z], OS[Linux/5.4.0-81-generic/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/11.0.11/11.0.11+9]

In this log entry, the Elasticsearch version is `7.17.3`.

Method 3: Using the Elasticsearch Command Line

If you have access to the Elasticsearch installation directory, you can use the `elasticsearch` command with the `–version` flag to check the version:

`bash
./bin/elasticsearch --version

The output will display the version number:

Version: 7.17.3, Build: default/tar/abcdef123456/2021-09-22T21:37:37.881534Z, JVM: 11.0.11

In this example, the Elasticsearch version is `7.17.3`.

Conclusion

Checking the Elasticsearch version is crucial for ensuring compatibility and understanding the available features. You can use any of the methods mentioned above to determine the version of your Elasticsearch cluster.


Related log errors to this ES concept


Unknown license version found please upgrade all nodes to the latest elasticsearch-license
Cannot kill the process on node with version
One of the shards is incompatible with the required minimum version
Feature states can only be used when all nodes in cluster are version
Translog looks like version 1 or later but has corrupted header

< Page: 5 of 5 >