ElasticSearch ElasticSearch Cluster Management & Administration 1 — Questions and Answers
Question 1: What is the default number of primary shards per index in Elasticsearch 7.x and later?
- 5
- 1 (Correct answer)
- 3
- 10
Correct answer: 1
Elasticsearch 7.0 changed the default number of primary shards from 5 to 1 to reduce over-sharding in new deployments.
Question 2: Which API endpoint returns the overall health status (green, yellow, or red) of an Elasticsearch cluster?
- GET /_cluster/stats
- GET /_nodes/stats
- GET /_cluster/health (Correct answer)
- GET /_cat/nodes
Correct answer: GET /_cluster/health
GET /_cluster/health returns the cluster health status along with shard counts, active nodes, and other cluster-level details.
Question 3: What does a 'red' cluster health status indicate in Elasticsearch?
- All primary and replica shards are assigned
- Some replica shards are unassigned
- At least one primary shard is unassigned (Correct answer)
- The cluster is undergoing a rolling restart
Correct answer: At least one primary shard is unassigned
A red status means at least one primary shard is not allocated, making some data potentially inaccessible.
Question 4: What is the minimum number of master-eligible nodes recommended to avoid a split-brain scenario in Elasticsearch?
- 2
- 3 (Correct answer)
- 4
- 5
Correct answer: 3
Three master-eligible nodes with quorum-based voting (majority of 2) prevents split-brain where two network partitions each elect their own master.
Question 5: Which Elasticsearch cluster-level setting limits the total number of open shards allowed per data node?
- cluster.max_shards_per_node (Correct answer)
- index.number_of_shards
- node.max_local_storage_nodes
- cluster.routing.allocation.total_shards_per_node
Correct answer: cluster.max_shards_per_node
The cluster.max_shards_per_node setting caps the number of open shards on any single node to prevent resource exhaustion from over-sharding.
Question 6: What is the primary responsibility of the master node in an Elasticsearch cluster?
- Executing search queries and aggregations
- Managing cluster-wide state including index creation and shard allocation (Correct answer)
- Storing and retrieving document data
- Load balancing client requests across data nodes
Correct answer: Managing cluster-wide state including index creation and shard allocation
The master node manages the cluster state, including creating and deleting indices, allocating shards, and tracking which nodes belong to the cluster.
Question 7: What happens when cluster.routing.allocation.enable is set to 'none' in Elasticsearch?
- All shard allocations are disabled, preventing any new shard assignments (Correct answer)
- Only replica shard allocations are disabled
- New index creation is prevented
- The cluster stops electing a new master node
Correct answer: All shard allocations are disabled, preventing any new shard assignments
Setting cluster.routing.allocation.enable to 'none' disables all shard allocations, which is useful during maintenance operations such as rolling upgrades.
What is the default number of primary shards per index in Elasticsearch 7.x and later?