Node Roles: Master, Data and Coordinating
The bookshop grows and one node is no longer enough. You add machines — but not every node has to do every job. Elasticsearch lets you give each node roles, and knowing the three main ones explains most cluster designs you will ever see.
The rule
Master nodes manage, data nodes store and search, coordinating nodes route and gather.
- Master-eligible node (
masterrole) — can be elected the master. The elected master keeps the cluster state: which indices exist, their mappings, which node holds which piece of data, which nodes have joined or left. It does bookkeeping, not heavy searching. - Data node (
datarole, or tiered versions likedata_hotanddata_warm) — holds the actual documents and does the work on them: indexing, searching, aggregating. Data nodes need disk, memory and CPU. - Coordinating node — receives a client's request, forwards pieces of it to the data nodes that hold the relevant data, then merges their partial answers into one reply. Every node coordinates the requests it receives; a coordinating-only node is one with no other roles.
Roles are set in elasticsearch.yml:
# a dedicated master-eligible node
node.roles: [ master ]
# a data node
node.roles: [ data ]
# a coordinating-only node: an empty list
node.roles: [ ]If you set nothing, a node takes almost every role — perfect for a laptop, risky for a big cluster, where a master busy with heavy searches can become slow to manage the cluster.
Other roles exist (ingest for pre-processing documents, ml for machine learning, transform), but these three are the skeleton.
The shortcut
For any node, ask "does it decide, hold, or hand off?" Decides cluster-wide changes → master. Holds data → data. Only hands requests out and merges results → coordinating-only.
Hand off
The client's
GET /books/_searchlands on a coordinating-only node, which asks the cluster state where thebooksdata lives.
Drills
Answer fast — trust the rule.
Which node keeps track of which indices exist and where their data lives?
How do you configure a coordinating-only node?
Which role needs the most disk space?
Why do large clusters often use dedicated master nodes?
Remember
- Master nodes manage, data nodes store and search, coordinating nodes route and gather.
- Every node coordinates;
node.roles: [ ]makes a coordinating-only node. - Decide → master, hold → data, hand off → coordinating.
