Multi-AZ HA
To prevent data loss and minimize the cluster downtime upon service interruption, select two or three AZs in the same region when creating a cluster, and then the system properly allocates nodes to the AZs.
Allocating Nodes
If you select two or three AZs when creating a cluster, CSS automatically enables the cross-AZ HA function and properly allocates nodes to different AZs.
The following table lists the way nodes are allocated.
|
Nodes |
One AZ |
Two AZs |
Three AZs |
|||
|
AZ1 |
AZ1 |
AZ2 |
AZ1 |
AZ2 |
AZ3 |
|
|
1 |
1 |
Not supported |
Not supported |
|||
|
2 |
2 |
1 |
1 |
Not supported |
||
|
3 |
3 |
2 |
1 |
1 |
1 |
1 |
|
4 |
4 |
2 |
2 |
2 |
1 |
1 |
|
... |
... |
... |
... |
... |
... |
... |
- CSS does not require that the number of nodes be a multiple of that of AZs.
- When creating a cluster, ensure that the number of nodes you configure is no less than the number of AZs.
- The node quantity gap between any two AZs must be no more than one.
Configuring Replicas
HA can be ensured when you properly configure the number of replicas.
- In a two-AZ deployment mode, when one AZ is unavailable, the other one is required to provide services. Therefore, at least one replica is required. The default number of Elasticsearch replicas is one. In this case, you can retain the default value if you do not expect too much for the read performance.
- In a three-AZ deployment mode, when one or two of the AZs are unavailable, the remaining AZs are required to provide services. Therefore, at least two replicas are needed. In this case, you need to modify the replica configurations to change the number of replicas because the default number of Elasticsearch replicas is one.
You can run the following command to modify the number of index replicas:
curl -XPUT http://ip:9200/{index_name}/_settings -d '{"number_of_replicas":2}'
Alternatively, specify the number of replicas in the template:
curl -XPUT http://ip:9200/ _template/templatename -d '{ "template": "*", "settings": {"number_of_replicas": 2}}'
- ip: private network address
- number_of_replicas: number of replicas after modification. The value in the preceding command indicates that two replicas are required.
Selecting Master Nodes
If you select the master node function when creating a cluster, master nodes are properly allocated in different AZs when you select multiple AZs.
Service Interruption
Table 1 shows the service fault analysis if you select two or three AZs when creating a cluster and one AZ is faulty.
|
AZs |
Master Nodes |
Service Interruption Analysis |
|---|---|---|
|
2 |
0 |
|
|
2 |
3 |
You may have 50% of possibilities for service interruption. When two dedicated master nodes are allocated to one AZ and another master node is allocated to the other AZ,
|
|
3 |
0 |
If you configure four nodes in three AZs, each AZ is allocated with two, one, and one node respectively. Services will be interrupted if the AZ with two nodes is faulty. Therefore, you are advised not to configure four nodes when selecting three AZs. Generally, service interruption does not occur. |
|
3 |
3 |
Service interruption does not occur. |
Last Article: Clusters in Security Mode
Next Article: Performance Metrics
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.