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.
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.
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:
node.master: true
node.data: true
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:
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 |
|
|
This is the default node. It can be the master, which contains data. |
|
|
This node never becomes a master node, it only holds data. It can be defined as a workhorse of your cluster. |
|
|
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. |
|
|
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.
3.21.43.26