`node.roles` is an Elasticsearch setting in `elasticsearch.yml` that assigns one or more responsibilities to a node. Role assignment lets a cluster separate cluster management, document storage and search, ingestion, and machine-learning work across nodes rather than expecting every node to do everything. section 3.2.5
Table 3.2 Node roles and responsibilities (view table figure)
| Responsible for the transformation of data via pipeline ingestion before indexing. |
|
| This is the default role. It takes care of incoming client requests. |
Node roles divide work: master nodes manage the cluster, data nodes persist and retrieve documents, ingest nodes transform data before indexing, and machine-learning and transform nodes handle their respective requests. Every node also acts as a coordinating node for incoming client requests; coordinating is not enabled with a separate flag. section 3.2.5
Assign several roles to one node
A node can carry multiple roles. For a smaller deployment, this configuration makes one node eligible for master, data, ingest, and machine-learning work: node.roles: [master, data, ingest, ml] The node still coordinates client requests in addition to these listed roles. In development mode, nodes start with master, data, and ingest roles by default; explicit settings let a larger cluster specialize nodes as needed. section 3.2.5
Create a dedicated coordinating node
Use an empty role list when a node should only coordinate requests: node.roles: [] A dedicated coordinator distributes incoming requests, waits for node responses, and collates results for the client. This can act like load balancing, but making many nodes coordinators alone carries more risk than benefit. section 3.2.5
A practical cluster might use three master nodes, 15 data nodes, and two ingest nodes out of 20 nodes. Roles are configured per node, while adding nodes also gives Elasticsearch places to allocate replica shards and reduce the data-loss and performance risks of a single-node setup. Keep security enabled for production nodes; Elasticsearch 8.0 and later enables it by default. section 3.2.5 section 14.1.2
