1. Nodes and roles #
Who does what.
Roles #
# elasticsearch.yml d'un nœud data hot
node.name: es-hot-01
node.roles: [ data_hot, data_content, ingest ]
node.attr.zone: eu-west-3aThe elected master node maintains the cluster state: list of nodes, mappings, location of each shard. A quorum of eligible nodes is required: with 3 eligible nodes, the cluster tolerates the loss of only one.
Common mistake: Two master-eligible nodes protect against nothing: losing one loses the quorum. Use 3 nodes (or 2 + a voting_only node).2. Shards and replicas #
How data is distributed.
Principle #
- An index is split into primary shards (fixed at creation); each one is a Lucene index.
- Each primary has replicas (changeable on the fly): high availability and read capacity.
- A replica is never placed on the same node as its primary.
- Green status: everything is allocated; yellow: replicas are missing; red: primaries are missing.
3. Allocation and failures #
What happens when a node goes down.
Allocation #
- The node stops responding: the master removes it from the cluster.
- The replicas of its primaries are promoted to primaries: no data lost, the cluster turns yellow.
- After
index.unassigned.node_left.delayed_timeout(1 minute by default), new replicas are rebuilt on the remaining nodes. - When the node comes back, Elasticsearch rebalances the shards.
GET _cluster/health
GET _cat/shards?v&h=index,shard,prirep,state,node,unassigned.reason
GET _cluster/allocation/explain
# répartir les répliques entre zones de disponibilité
PUT _cluster/settings
{ "persistent": { "cluster.routing.allocation.awareness.attributes": "zone" } }Good practice: With zone-based allocation awareness, a replica and its primary are always in two different zones: losing an entire zone loses no data.
My progress
Sign in to track your progress and take notes. Sign in
💬 Recent discussions about this course
- Elasticsearch : supprimer automatiquement les logs de plus de 30 jours✓ solved · 1 reply(ies)
Ask a question about this lesson →See all discussions about this course
Course Glossary
RBAC (Role-Based Access Control)
An access control method where permissions are assigned to specific roles (e.g., admin, reader) rather than directly to individual users.
Authentication
The process of verifying the identity of a user or system (e.g., login/password, tokens, biometrics).
Authorization
The process that occurs after authentication to determine if the entity has the necessary rights and privileges to access a resource.
API Key
A unique alphanumeric code used to identify, authenticate, and authorize access to an Application Programming Interface (API).
Architecture
The overall structural design of an IT system, defining its various components, their relationships, and the principles guiding its evolution.
Repository
A centralized storage location. This can refer to a source code repository (e.g., Git) or an artifact and binary repository (e.g., Harbor, Nexus, Arti...
Elasticsearch
A distributed, RESTful search and analytics engine capable of addressing a growing number of use cases, built on Apache Lucene.
Recommended Articles
Elasticsearch monitoring and troubleshooting: health, unassigned shards, JVM, hot threads and slow logs
Diagnose an Elasticsearch cluster: cluster health and CAT APIs, unassigned shards and allocation ...
The OpenSearch cluster in depth: nodes, shards and replication
Understanding how an OpenSearch cluster works inside: node roles, cluster manager election, shard...
Elasticsearch performance and capacity planning: shards, heap, indexing and benchmarks
Size and optimize Elasticsearch: shard size and count, JVM heap, caches, indexing settings (refre...
OpenSearch: concepts, architecture and differences with Elasticsearch
Understanding OpenSearch: project origin, license, differences with Elasticsearch, indexes, shard...
Advanced Elasticsearch Query DSL and aggregations, with ES|QL
Write advanced Elasticsearch queries: bool, filter and score, nested, function_score and BM25 rel...
Elasticsearch best practices: mappings, shards, lifecycle and operations
Elasticsearch best practices: shard sizing, explicit mappings, templates, ILM, JVM memory, securi...
Advanced Elasticsearch security: TLS, certificates, API keys, FLS, DLS and audit
Secure Elasticsearch in depth: transport and HTTP TLS, certificate management with elasticsearch-...
OpenTelemetry and Elasticsearch: compatibility and architecture
Send OpenTelemetry to Elasticsearch: Collector and elasticsearch exporter, managed OTLP endpoint,...
Distributed tracing with Jaeger: concepts and architecture
The concepts of distributed tracing (trace, span, context, propagation) and Jaeger: its history, ...