0
0
Elasticsearchquery~20 mins

Node roles (master, data, ingest) in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Elasticsearch Node Roles Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of the cluster health API for a single master-eligible node?

Consider an Elasticsearch cluster with only one node configured as master-eligible but not data or ingest. What will the cluster.health API report for the number_of_data_nodes?

Elasticsearch
GET /_cluster/health
A{"number_of_data_nodes":0}
B{"number_of_data_nodes":1}
C{"number_of_data_nodes":-1}
D{"number_of_data_nodes":null}
Attempts:
2 left
💡 Hint

Master nodes do not hold data unless explicitly configured.

Predict Output
intermediate
2:00remaining
What happens when an ingest node processes a document?

Given a node configured only as an ingest node, what is the expected behavior when a document is sent to it for indexing?

Elasticsearch
PUT /my-index/_doc/1
{
  "field": "value"
}
AThe ingest node processes the document pipeline and forwards it to a data node for storage.
BThe ingest node stores the document locally without forwarding.
CThe ingest node rejects the document with an error.
DThe ingest node converts the document to a master node for storage.
Attempts:
2 left
💡 Hint

Ingest nodes handle preprocessing but do not store data.

🧠 Conceptual
advanced
1:30remaining
Which node role is responsible for cluster state management?

In Elasticsearch, which node role primarily manages the cluster state and coordinates cluster-wide actions?

AData node
BMaster-eligible node
CIngest node
DCoordinating-only node
Attempts:
2 left
💡 Hint

Think about which node decides the cluster's overall health and configuration.

Predict Output
advanced
2:00remaining
What error occurs if a data node is down during indexing?

Assume a cluster with one master-eligible node and one data node. If the data node is down and you try to index a document, what error will Elasticsearch return?

Elasticsearch
PUT /my-index/_doc/1
{
  "field": "value"
}
A{"error":{"type":"illegal_argument_exception","reason":"cannot index on master node"}}
B{"error":{"type":"index_not_found_exception","reason":"no such index"}}
C{"error":{"type":"unavailable_shards_exception","reason":"primary shard is not active"}}
D{"error":{"type":"cluster_block_exception","reason":"blocked by: [SERVICE_UNAVAILABLE/1/no master];"}}
Attempts:
2 left
💡 Hint

Think about shard availability on data nodes.

🔧 Debug
expert
3:00remaining
Why does this cluster fail to elect a master node?

Given a cluster with three nodes, all configured as node.data: true but node.master: false, why does the cluster fail to elect a master?

node1.yml:
node.master: false
node.data: true

node2.yml:
node.master: false
node.data: true

node3.yml:
node.master: false
node.data: true
AData nodes cannot communicate with each other without a master node.
BThe cluster name is missing, causing election failure.
CThe cluster requires at least one ingest node to elect a master.
DNo node is master-eligible, so no master election can occur.
Attempts:
2 left
💡 Hint

Master election requires at least one master-eligible node.