liveBook · Manning

Node.roles

As explained in Elasticsearch in Action, Second Edition

node.roles is an Elasticsearch configuration setting containing the list of roles assigned to a node.

`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)

Role

Description

Master node

Its primary responsibility is cluster management.

Data node

Responsible for document persistence and retrieval.

Ingest node

Responsible for the transformation of data via pipeline ingestion before indexing.

Machine learning node

Handles machine learning jobs and requests.

Transform node

Handles transformation requests.

Coordination node

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

How Elasticsearch in Action, Second Edition covers it

How deep it goes
Explains YAML role lists, multi-role nodes, default coordination, and dedicated coordinators without detailing role internals.
Examples
Uses a 20-node role split, a multi-role YAML list, an empty role list, and a single-node cluster gaining a replica.
What it assumes
Introduces node responsibilities from zero while assuming access to Elasticsearch configuration and a cluster deployment.
What you can do after
Operate/configure it by assigning one or several node roles or creating a dedicated coordinating node in elasticsearch.yml.
How it connects
Connects node roles with coordinating nodes, cluster management, data retrieval, ingestion pipelines, machine learning, transforms, and replica shards.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elasticsearch in Action, Second Edition. The section links point to the parts of the book it draws on.