Setting up different node types

Elasticsearch is natively designed for the cloud, so when you need to release a production environment with a huge number of records and you need high availability and good performances, you need to aggregate more nodes in a cluster.

Elasticsearch allows defining different type of nodes to balance and improve overall performances.

Getting ready

You need a working Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe and a simple text editor to change the configuration files.

How to do it...

For advance, set up a cluster. There are some parameters that must be configured to define different node types.

These parameters are in config/elasticsearch.yml file and they can be set with the following steps:

  1. Set up whether the node can be master or not:
            node.master: true 
    
  2. Set up whether a node must contain data or not:
            node.data: true 
    

How it works...

The node.master parameter defines that the node can become master for the cloud. The default value for this parameter is true.

A master node is an arbiter for the cloud: it takes decisions about shard management, it keeps the cluster status, and it's the main controller of every index action. If your master nodes are on overload, all the clusters will have penalty performances.

The optimum number of master nodes is given by the following equation:

How it works...

The node.data allows you to store data in the node. The default value for this parameter is true. This node will be a worker that index and search data.

By mixing these two parameters, it's possible to have different node types as shown in the following table:

node.master

node.data

Node description

true

true

This is the default node. It can be the master, which contains data.

false

true

This node never becomes a master node, it only holds data. It can be defined as a workhorse of your cluster.

true

false

This node only serves as a master: to not store any data and to have free resources. This will be the coordinator of your cluster.

false

false

This node acts as a search load balancer (fetching data from nodes, aggregating results, and so on).

The more frequently used node type is the first one, but if you have a very big cluster or special needs, you can differentiate the scopes of your nodes to better serve searches and aggregations.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.43.136