---
title: "OpenSearch cluster fault tolerance"
sidebar_label: "Cluster fault tolerance"
sidebar_position: 11
description: "Node allocation in OpenSearch cluster node groups, how to change the number of nodes in a group"
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import {TabItemLabel} from '@selectel/docux/components';
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical';
import Formbricks from '@theme/MDXComponents/Formbricks';

# OpenSearch cluster fault tolerance

The fault tolerance of an OpenSearch managed database cluster is affected by:

* [index replication](#index-replication);
* [number of nodes in node groups](#number-nodes-in-groups) with [Manager](/managed-databases/opensearch/about-node-groups.mdx#manager-node-groups) and [Data](/managed-databases/opensearch/about-node-groups.mdx#data-node-groups) roles. Learn more about node groups and their roles in the [OpenSearch Node Groups](/managed-databases/opensearch/about-node-groups.mdx) guide;
* [node allocation type](#node-allocation-type) in node groups.

## Index replication \{#index-replication}

The cluster uses a standard index replication mechanism—for each primary shard, the number of replica shards you specified when creating the index is created. Writing to the index occurs only via primary shards, whereas reading can be performed simultaneously from both primary and replica shards.

## Number of nodes in node groups \{#number-nodes-in-groups}

A [node group with the Manager role](/managed-databases/opensearch/about-node-groups.mdx#manager-node-groups) consists of three nodes. You cannot change the number of nodes in this group or add another node group with the Manager role.

[A node group with the Data role](/managed-databases/opensearch/about-node-groups.mdx#data-node-groups) consists of one node by default. To increase the fault tolerance of the cluster, you can:

* [increase the number of nodes in the group with the Data role in an existing cluster](#increase-number-nodes) or when [creating a cluster](/managed-databases/opensearch/create-cluster.mdx). You can add from one to ten nodes to each node group;
* [add another node group with the Data role in an existing cluster](#add-data-node-groups) or when [creating a cluster](/managed-databases/opensearch/create-cluster.mdx). There can be no more than two node groups with the Data role in the cluster.

## Node allocation type \{#node-allocation-type}

The node allocation type in a cluster depends on:

* the number of nodes in a [group](/managed-databases/opensearch/about-node-groups.mdx);
* the type of [pool](/infrastructure/locations.mdx#pool) where the cluster is located;
* the number of segments in the pool;
* [configuration line](/managed-databases/opensearch/configurations.mdx#configuration-lines).

You can view the list of pools and segments in the [Selectel Infrastructure](/infrastructure/locations.mdx#selectel-infrastructure) table in the [Locations: countries, regions, availability zones, pools, and data center addresses](/infrastructure/locations.mdx) guide.

Four node allocation types are available:

* Single-Segment;
* Multi-Segment;
* Single-AZ;
* Multi-AZ.

<Tabs queryString="node-allocation-type">
  <TabItem value="single-segment-allocation" default>
    <TabItemLabel>
      Single-Segment
    </TabItemLabel>

    Nodes are placed in the same segment of a [single-zone pool](/infrastructure/locations.mdx#single-az-pool). Applicable:

    * a [node group with the Data role](/managed-databases/opensearch/about-node-groups.mdx#data-node-groups) that has only one node;
    * node groups with multiple nodes, if the cluster is located in a pool with only one segment;
    * node groups with multiple nodes in [HighFreq](/managed-databases/opensearch/configurations.mdx#highfreq-line) configurations.

    :::note

    For example, you created a cluster in the ru-2 pool and used configurations from the HighFreq line for node groups with Manager and Data roles. All nodes of both groups will be placed in the same pool segment, for example, ru-2c.

    :::
  </TabItem>

  <TabItem value="multi-segment-allocation">
    <TabItemLabel>
      Multi-Segment
    </TabItemLabel>

    Nodes are placed in different segments of a [single-zone pool](/infrastructure/locations.mdx#single-az-pool). Applicable to node groups with multiple nodes if the cluster is located in a multi-segment pool.

    Segments are located in different racks of the same data center. Nodes are distributed across segments sequentially.

    :::note

    For example, you created a cluster in the ru-1 pool, and specified one node in the node group with the Data role. All three nodes of the group with the Manager role will be placed sequentially in the ru-1a, ru-1b, and ru-1c pool segments. The node of the group with the Data role will be placed in the ru-1a segment. If you add a second node to the group with the Data role, it will be placed in the ru-1b pool segment.

    :::
  </TabItem>

  <TabItem value="single-az-allocation">
    <TabItemLabel>
      Single-AZ
    </TabItemLabel>

    Nodes are placed in the same segment of a [multi-zone pool](/infrastructure/locations.mdx#multi-az-pool). Applicable for a node group with the Data role that contains only one node, if the cluster is located in the ru-6 pool.

    If you increase the number of nodes in the group, the node allocation type will change to Multi-AZ.

    :::note

    For example, you created a cluster in the ru-1 pool, and specified one node in the node group with the Data role. The node will be placed in one pool segment, for example, ru-6a.

    :::
  </TabItem>

  <TabItem value="multi-az-allocation">
    <TabItemLabel>
      Multi-AZ
    </TabItemLabel>

    Nodes are placed in different segments of a [multi-zone pool](/infrastructure/locations.mdx#multi-az-pool). Applicable to node groups with multiple nodes if the cluster is located in the ru-6 pool.

    Each pool segment is located in a separate data center. Nodes are distributed across segments sequentially.

    :::note

    For example, you created a cluster in the ru-6 pool, and specified one node in the node group with the Data role. All three nodes of the group with the Manager role will be placed sequentially in the ru-6a, ru-6b, and ru-6c pool segments. The node of the group with the Data role will be placed in the ru-6a segment. If you add a second node to the group with the Data role, it will be placed in the ru-6b pool segment.

    :::
  </TabItem>
</Tabs>

## Increase the number of nodes in a group with the Data role \{#increase-number-nodes}

You can add no more than ten nodes to a [node group with the Data role](/managed-databases/opensearch/about-node-groups.mdx#data-node-groups).

1. In the [Dashboard](https://my.selectel.ru/vpc/default/dbaas/), on the top menu, click **Products** and select **Managed Databases**.
2. Open the **Active** tab.
3. Open the database cluster page → **Settings** tab.
4. In the menu  of node groups with the Data role, select **Change configuration**.<MoreVerticalIcon />
5. Specify the number of nodes in the group.
6. Click **Save**.

## Add a node group with the Data role \{#add-data-node-groups}

The total number of [node groups with the Data role](/managed-databases/opensearch/about-node-groups.mdx#data-node-groups) in a cluster cannot exceed two.

1. In the [Dashboard](https://my.selectel.ru/vpc/default/dbaas/) on the top menu, click **Products** and select **Managed Databases**.

2. Open the **Active** tab.

3. Open the database cluster page → **Settings** tab.

4. In the **Cluster** block, click **Add node group**.

5. Optional: change the node group name.

6. Select a node group with the Data role.

7. Select a [configuration line](/managed-databases/opensearch/configurations.mdx#configuration-lines).

8. If you selected a line with custom configurations, specify the number of vCPUs, RAM size, and disk size.

9. If you selected a line with fixed configurations, select a configuration.

10. Specify the number of nodes in the group.

11. Optional: to make the group nodes accessible from the internet, connect a public IP address to them:

    * if you have selected an existing private subnet, turn on the **Public access** toggle. The private subnet must meet the [requirements](/managed-databases/redis/public-ip.mdx#requirements);
    * if you are creating a new private subnet, [assign a public IP address](/managed-databases/redis/public-ip.mdx#assign-public-ip-in-existing-cluster) after adding the node group.

    IP addresses are automatically assigned to all nodes in the group.

12. Click **Save**.

<Formbricks />
