Category: elasticsearch
-
Can We Change the Number of Shards Later? And How Many Replicas Should We Use?
Two of the most common questions people ask after they start using Elasticsearch seriously are these: “I created an index with five shards. Now I realize I need eight. How can I change it?”“How many replica shards should I configure?” Both questions look simple on the surface, but both are deeply connected to how Elasticsearch…
-
How Many Primary Shards Should You Create in Elasticsearch?
One of the first questions that almost everyone asks, sooner or later, is this: “How many primary shards should I create for my index?” If you have asked this question before, you are absolutely not alone. In fact, this is one of the most common questions in the Elasticsearch community. Unfortunately, it is also a…
-
Understanding Cluster Settings in Elasticsearch
In this tutorial, we are going to look at cluster-level settings in Elasticsearch and understand why they exist, how to view them, and how to change them at runtime. Even though this is a “quick” lecture conceptually, the topic itself is very important, because cluster settings control global behavior of your entire Elasticsearch cluster, not…
-
Optimistic Concurrency Control in Elasticsearch
In this tutorial, we are going to study a concept that becomes extremely important the moment multiple applications or multiple users start updating the same data concurrently. This concept is called optimistic concurrency control. We have briefly seen something related to versioning earlier, but that old mechanism is now considered deprecated. In modern Elasticsearch, concurrency…
-
The Coordinating Role in Elasticsearch
In all our previous cluster experiments, we focused mainly on master nodes, data nodes, and role separation, but there is one responsibility that every Elasticsearch node performs silently in the background. This responsibility is called coordination, and it plays a critical role in how distributed search actually works in practice. Whenever a client sends a…
-
Configuring Dedicated Master and Data Nodes Using Node Roles in Elasticsearch
Why Do We Need Dedicated Master Nodes? In Elasticsearch, the master node is responsible for cluster management, not for serving search results. The master node handles things like: What the master node does not do: Because of this, in real systems: We want the master node to be as stable, light, and undisturbed as possible.…
-
Understanding Distributed Search in Elasticsearch
In this tutorial, we are going to perform a very important practical experiment that will help you visually and conceptually understand how Elasticsearch distributes data across nodes and shards, and how it still gives you a single combined search result. This is one of the core ideas behind Elasticsearch’s scalability and performance. We will create…
-
Understanding Master Election in an Elasticsearch Cluster
In this tutorial, we are going to observe and understand the master election process in Elasticsearch by performing a few controlled experiments on our already running three-node cluster. Until now, we have been using the cluster normally, but we have not really tested what happens when nodes go down and come back up. This is…
-
Setting Up a Three-Node Elasticsearch Cluster Using Docker Compose
In this tutorial, we are going to move from a single-node Elasticsearch setup to a real multi-node cluster consisting of three Elasticsearch nodes and one Kibana instance, all running locally using Docker Compose. This is an extremely important milestone in learning Elasticsearch, because features such as sharding, replication, fault tolerance, node discovery, and master election…
-
Node Roles in Elasticsearch – How Responsibilities Are Distributed in a Cluster
Before we spin up a multi-node Elasticsearch cluster, it is extremely important to understand node roles.Node roles define what responsibilities each node is allowed to perform inside the cluster, and they play a crucial role in scalability, stability, performance, and resource planning. In this tutorial, we will slowly build a clear mental model of why…
