Briefly, this error occurs when there is a version mismatch between the nodes in an Elasticsearch cluster. This can happen if you’ve upgraded some nodes but not others, or if you’re trying to connect nodes from different versions. To resolve this issue, you can either upgrade all nodes to the same version or downgrade the nodes to match the version of the rest of the cluster. It’s important to ensure compatibility across all nodes in the cluster for optimal performance and stability.
This guide will help you check for common problems that cause the log ” remote node [{}] is build [{}] of version [{}] but this node is build [{}] of version [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: node, version.
Overview
To put it simply, a node is a single server that is part of a cluster. Each node is assigned one or more roles, which describe the node’s responsibility and operations. Data nodes store the data, and participate in the cluster’s indexing and search capabilities, while master nodes are responsible for managing the cluster’s activities and storing the cluster state, including the metadata.
While it is possible to run several node instances of Elasticsearch on the same hardware, it’s considered a best practice to limit a server to a single running instance of Elasticsearch.
Nodes connect to each other and form a cluster by using a discovery method.
Roles
Master node
Master nodes are in charge of cluster-wide settings and changes – deleting or creating indices and fields, adding or removing nodes and allocating shards to nodes. Each cluster has a single master node that is elected from the master eligible nodes using a distributed consensus algorithm and is reelected if the current master node fails.
Coordinating (client) node
There is some confusion in the use of coordinating node terminology. Client nodes were removed from Elasticsearch after version 2.4 and became coordinating nodes.
Coordinating nodes are nodes that do not hold any configured role. They don’t hold data and are not part of the master eligible group nor execute ingest pipelines. Coordinating nodes serve incoming search requests and act as the query coordinator running query and fetch phases, sending requests to every node that holds a shard being queried. The coordinating node also distributes bulk indexing operations and route queries to shards based on the node’s responsiveness.
Overview
A version corresponds to the Elasticsearch built-in tracking system that tracks the changes in each document’s update. When a document is indexed for the first time, it is assigned a version 1 using _version key. When the same document gets a subsequent update, the _version is incremented by 1 with every index, update or delete API call.
What it is used for
A version is used to handle the concurrency issues in Elasticsearch which come into play during simultaneous accessing of an index by multiple users. Elasticsearch handles this issue with an optimistic locking concept using the _version parameter to avoid letting multiple users edit the same document at the same time and protects users from generating incorrect data.
Notes
You cannot see the history of the document using _version. That means Elasticsearch does not use _version to keep a track of original changes that had been performed on the document. For example, if a document has been updated 10 times, it’s _version would be marked by Elasticsearch as 11, but you cannot go back and see what version 5 of the document looked like. This has to be implemented independently.
Common problems
If optimistic locking is not implemented while making updates to a document, Elasticsearch may return a conflict error with the 409 status code, which means that multiple users are trying to update the same version of the document at the same time.
POST /ratings/123?version=50 { "name": "Joker", "rating": 50 }
Log Context
Log “remote node [{}] is build [{}] of version [{}] but this node is build [{}] of version [{}] ” classname is TransportService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :
} } if (isIncompatibleBuild(version; buildHash; requireCompatibleBuild)) { if (PERMIT_HANDSHAKES_FROM_INCOMPATIBLE_BUILDS) { logger.warn("remote node [{}] is build [{}] of version [{}] but this node is build [{}] of version [{}] " + "which may not be compatible; remove system property [{}] to resolve this warning"; discoveryNode; buildHash; version; Build.CURRENT.hash(); Version.CURRENT; PERMIT_HANDSHAKES_FROM_INCOMPATIBLE_BUILDS_KEY); } else { throw new IllegalArgumentException("remote node [" + discoveryNode + "] is build [" + buildHash +
[ratemypost]