Managing OpenSearch host groups
In a Managed Service for OpenSearch cluster, you can manage host groups:
- Get a list of host groups in a cluster.
- Create a host group.
- Update the configuration of a host group, including adding new hosts to it or removing them.
- Delete a host group.
You can also get a list of cluster hosts.
For information about migrating host groups in a Managed Service for OpenSearch cluster to a different availability zone, see this guide.
Getting a list of host groups in a cluster
- In the management console
, navigate to the folder page. - Navigate to the Managed Service for OpenSearch service.
- Click the name of the cluster you need and select the
Node groups tab.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To get a list of host groups in a cluster, get the OpenSearch cluster details:
yc managed-opensearch cluster get <cluster_name_or_ID>
You can find the list of host groups in the config.opensearch.node_groups and config.dashboards.node_groups parameters.
You can get the cluster name and ID with the list of clusters in the folder.
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.Get method, e.g., via the following cURL
request:curl \ --request GET \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>'You can get the cluster ID with the list of clusters in the folder.
-
View the server response to make sure your request was successful.
You can find available host groups in the
nodeGroupsparameters.
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume that the repository contents reside in the
~/cloudapi/directory. -
Call the ClusterService.Get method, e.g., via the following gRPCurl
request:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.opensearch.v1.ClusterService.GetYou can get the cluster ID with the list of clusters in the folder.
-
View the server response to make sure your request was successful.
You can find available host groups in the
nodeGroupsparameters.
Creating a host group
The following limitations apply when creating host groups:
- A Managed Service for OpenSearch cluster may contain only one
Dashboardshost group. - If you are adding a group of
OpenSearchhosts with theMANAGERrole, make sure there are at least three hosts with this role.
To create a host group:
-
In the management console
, navigate to the folder page. -
Navigate to the Managed Service for OpenSearch service.
-
Click the name of the cluster you need and select the
Node groups tab. -
Click Create node group.
-
Specify the group parameters:
-
Group type:
OpenSearchorDashboards. -
Name. It must be unique within the cluster.
-
For an
OpenSearchhost group, select the host role. -
Platform, host type, and host class.
The host class defines the specifications of virtual machines OpenSearch nodes will be deployed on. All available options are listed under Host classes.
-
Disk type and data storage size.
The selected type determines the increments in which you can change your disk size:
- Network HDD and SSD storage: In increments of 1 GB.
- Local SSD storage:
- For Intel Cascade Lake: In increments of 100 GB.
- For Intel Ice Lake: In increments of 368 GB.
- Non-replicated SSD storage: In increments of 93 GB.
-
Optionally, set up automatic storage expansion:
-
In the Increase size field, specify the conditions for the actions below:
-
Storage expansion during the next maintenance window once the fill level exceeds the specified percentage. If you set this condition, configure the maintenance window schedule.
-
Storage expansion immediately once the fill level exceeds the specified percentage.
Warning
If you set both conditions, make sure the immediate expansion threshold is higher than the scheduled one.
-
-
Specify the maximum storage size after the expansion in the Maximum storage size field.
Warning
- You cannot decrease the storage size.
- When scaling your storage, the cluster hosts will be unavailable.
-
-
Host distribution across availability zones and subnets.
-
Number of hosts to create.
-
Enable Public access if you want to allow connections to hosts over the internet.
-
-
Click Create node group.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To create a host group, run this command:
yc managed-opensearch node-group add --cluster-name <cluster_name> \
--opensearch-node-group name=<OpenSearch_host_group_name>,`
`resource-preset-id=<host_class>,`
`disk-size=<disk_size_in_bytes>,`
`disk-type-id=<disk_type>,`
`hosts-count=<number_of_hosts_in_group>,`
`zone-ids=<availability_zones>,`
`subnet-names=<subnet_names>,`
`assign-public-ip=<allow_public_access_to_hosts>,`
`roles=<host_roles> \
--dashboards-node-group name=<Dashboards_host_group_name>,`
`resource-preset-id=<host_class>,`
`disk-size=<disk_size_in_bytes>,`
`disk-type-id=<disk_type>,`
`hosts-count=<number_of_hosts_in_group>,`
`zone-ids=<availability_zones>,`
`subnet-names=<subnet_names>,`
`assign-public-ip=<allow_public_access_to_hosts>
Specify the required parameters in the command depending on what type of host group you want to create:
-
--opensearch-node-group:OpenSearchhost group configuration, where:-
resource-preset-id: Host class that defines the specifications of virtual machines the OpenSearch nodes will be deployed on. All available options are listed under Host classes. -
disk-size: Disk size, in bytes. The minimum and maximum values depend on the selected host class. -
disk-type-id: Disk type. -
zone-ids: Availability zones. Separate zones with commas and enclose them in square brackets, e.g.:zone-ids=[ru-central1-a,ru-central1-b,ru-central1-d] -
subnet-names: Names of the subnets in the specified availability zones. Separate subnets with commas and enclose them in square brackets, e.g.:subnet-names=[default-ru-central1-a,default-ru-central1-b,default-ru-central1-d]You can specify the
subnet-idsparameter with network IDs instead ofsubnet-names. Separate IDs with commas and enclosed them in square brackets, e.g.:subnet-ids=[e9bp8qmchqh2********,e2l963gkhobo********,fl8klaabecc3********] -
roles: Host roles. The possible values are:data: Assigns theDATArole only.manager: Assigns theMANAGERrole only.data+managerormanager+data: Assigns both roles.
Tip
For security reasons, we do not recommend enabling public access to hosts with the
MANAGERrole.
-
-
--dashboards-node-group:Dashboardshost group configuration. It is configured just as theOpenSearchhost group, except for the host roles. You do not need to set up any roles for theDashboardsgroup.
-
Open the current Terraform configuration file describing your infrastructure.
To learn how to create this file, see Creating a cluster.
For a complete list of Managed Service for OpenSearch cluster configuration fields you can update, see this Terraform provider guide.
-
To create a group of
OpenSearchhosts, add thenode_groupssection toopensearch:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... config { opensearch { ... node_groups { name = "<virtual_host_group_name>" assign_public_ip = <allow_public_access_to_hosts> hosts_count = <number_of_hosts> zone_ids = ["<list_of_availability_zones>"] subnet_ids = ["<list_of_subnet_IDs>"] roles = ["<role_list>"] resources { resource_preset_id = "<host_class>" disk_size = <storage_size_in_bytes> disk_type_id = "<disk_type>" } } } ... } }Where:
assign_public_ip: Public access to the host,trueorfalse.roles: Host roles,DATAandMANAGER.
-
To create a group of
Dashboardshosts, add thedashboardssection toconfig:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... config { ... dashboards { node_groups { name = "<virtual_host_group_name>" assign_public_ip = <allow_public_access_to_hosts> hosts_count = <number_of_hosts> zone_ids = ["<list_of_availability_zones>"] subnet_ids = ["<list_of_subnet_IDs>"] resources { resource_preset_id = "<host_class>" disk_size = <storage_size_in_bytes> disk_type_id = "<disk_type>" } } } } }Where
assign_public_ipis public access to the host,trueorfalse.A cluster may contain only one
Dashboardshost group. -
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
Timeouts
The Terraform provider sets the following timeouts for Managed Service for OpenSearch cluster operations:
- Creating a cluster, including by restoring it from a backup: 30 minutes.
- Updating a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the timeout are aborted.
How do I change these limits?
Add a
timeoutssection to the cluster description, e.g.:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... timeouts { create = "1h30m" # 1 hour 30 minutes update = "2h" # 2 hours delete = "30m" # 30 minutes } } -
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Create a file named
body.jsonand paste the following code into it:{ "nodeGroupSpec": { "name": "<host_group_name>", "resources": { "resourcePresetId": "<host_class>", "diskSize": "<storage_size_in_bytes>", "diskTypeId": "<disk_type>" }, "roles": ["<role_1>","<role_2>"], "hostsCount": "<number_of_hosts>", "zoneIds": [ "<availability_zone_1>", "<availability_zone_2>", "<availability_zone_3>" ], "subnetIds": [ "<subnet_1_ID>", "<subnet_2_ID>", "<subnet_3_ID>" ], "assignPublicIp": <allow_public_access_to_hosts>, "diskSizeAutoscaling": { "plannedUsageThreshold": "<scheduled_expansion_percentage>", "emergencyUsageThreshold": "<immediate_expansion_percentage>", "diskSizeLimit": "<maximum_storage_size_in_bytes>" } } }Where
nodeGroupscontain the host settings:-
name: Host group name. -
resources: Cluster resources:resourcePresetId: Host class.diskSize: Disk size, in bytes.diskTypeId: Disk type.
-
roles(OpenSearchhosts only): List of host roles,DATAorMANAGER. You can assign one or both roles for a group. -
hostsCount: Number of hosts in the group. The minimum number ofDATAandDashboardshosts is one; while the minimum number ofMANAGERhosts is three. -
zoneIds: List of availability zones the cluster hosts are located in. -
subnetIds: List of subnet IDs. -
assignPublicIp: Permission to connect to the host from the internet,trueorfalse. -
diskSizeAutoscaling: Automatic storage expansion settings:-
plannedUsageThreshold: Storage usage percentage to trigger a storage expansion during the next maintenance window.Use a value between
0and100%. The default value is0, i.e., automatic expansion is disabled.If you set this condition, configure the maintenance window schedule before creating your host group.
-
emergencyUsageThreshold: Storage usage percentage to trigger an immediate storage expansion.Use a value between
0and100%. The default value is0, i.e., automatic expansion is disabled.Warning
If you specify both thresholds,
emergencyUsageThresholdmust not be less thanplannedUsageThreshold. -
diskSizeLimit: Maximum storage size, in bytes, to set when storage usage reaches one of the specified thresholds.
Warning
- You cannot decrease the storage size.
- When scaling your storage, the cluster hosts will be unavailable.
-
-
-
To create an
OpenSearchhost group:-
Call the Cluster.AddOpenSearchNodeGroup method, e.g., via the following cURL
request:curl \ --request POST \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/opensearch/node_groups' \ --data "@body.json"You can get the cluster ID with the list of clusters in the folder.
-
View the server response to make sure your request was successful.
-
-
To create a
Dashboardshost group:-
Call the Cluster.AddDashboardsNodeGroup method, e.g., via the following cURL
request:curl \ --request POST \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/dashboards/node_groups' \ --data "@body.json"You can get the cluster ID with the list of clusters in the folder.
-
View the server response to make sure your request was successful.
-
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume that the repository contents reside in the
~/cloudapi/directory. -
Create a file named
body.jsonand paste the following code into it:{ "node_group_spec": { "name": "<host_group_name>", "resources": { "resource_preset_id": "<host_class>", "disk_size": "<storage_size_in_bytes>", "disk_type_id": "<disk_type>" }, "roles": ["<role_1>","<role_2>"], "hosts_count": "<number_of_hosts>", "zone_ids": [ "<availability_zone_1>", "<availability_zone_2>", "<availability_zone_3>" ], "subnet_ids": [ "<subnet_1_ID>", "<subnet_2_ID>", "<subnet_3_ID>" ], "assign_public_ip": <allow_public_access_to_hosts>, "disk_size_autoscaling": { "planned_usage_threshold": "<scheduled_expansion_percentage>", "emergency_usage_threshold": "<immediate_expansion_percentage>", "disk_size_limit": "<maximum_storage_size_in_bytes>" } } }Where
node_groupscontain the host settings:-
name: Host group name. -
resources: Cluster resources:resource_preset_id: Host class.disk_size: Disk size, in bytes.disk_type_id: Disk type.
-
roles(OpenSearchhosts only): List of host roles,DATAorMANAGER. You can assign one or both roles for a group. -
hosts_count: Number of hosts in the group. The minimum number ofDATAandDashboardshosts is one; while the minimum number ofMANAGERhosts is three. -
zone_ids: List of availability zones the cluster hosts are located in. -
subnet_ids: List of subnet IDs. -
assign_public_ip: Permission to connect to the host from the internet,trueorfalse. -
disk_size_autoscaling: Automatic storage expansion settings:-
planned_usage_threshold: Storage usage percentage to trigger a storage expansion during the next maintenance window.Use a value between
0and100%. The default value is0, i.e., automatic expansion is disabled.If you set this condition, configure the maintenance window schedule before creating your host group.
-
emergency_usage_threshold: Storage usage percentage to trigger an immediate storage expansion.Use a value between
0and100%. The default value is0, i.e., automatic expansion is disabled.Warning
If you specify both thresholds,
emergency_usage_thresholdmust not be less thanplanned_usage_threshold. -
disk_size_limit: Maximum storage size, in bytes, to set when storage usage reaches one of the specified thresholds.
Warning
- You cannot decrease the storage size.
- When scaling your storage, the cluster hosts will be unavailable.
-
-
-
To create an
OpenSearchhost group:-
Call the ClusterService.AddOpenSearchNodeGroup method, e.g., via the following gRPCurl
request:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d @ \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.opensearch.v1.ClusterService.AddOpenSearchNodeGroup \ < body.json -
View the server response to make sure your request was successful.
-
-
To create a
Dashboardshost group:-
Call the ClusterService.AddDashboardsNodeGroup method, e.g., via the following gRPCurl
request:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d @ \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.opensearch.v1.ClusterService.AddDashboardsNodeGroup \ < body.json -
View the server response to make sure your request was successful.
-
Updating a host group configuration
-
In the management console
, navigate to the folder page. -
Navigate to the Managed Service for OpenSearch service.
-
Click the name of the cluster you need and select the
Node groups tab. -
Click
in the row with the group you need and select Edit. -
Change the host group settings:
-
Host roles (for
OpenSearchhost groups only). -
Platform, host type, and host class.
The host class defines the specifications of virtual machines OpenSearch nodes will be deployed on. All available options are listed under Host classes.
-
Disk size.
Disk resizing increments depend on the disk type:
-
Network HDDs and SSDs: In increments of 1 GB.
-
Local SSDs:
- For Intel Cascade Lake: In increments of 100 GB.
- For Intel Ice Lake: In increments of 368 GB.
-
Non-replicated SSDs: In increments of 93 GB.
-
-
Optionally, set up automatic storage expansion:
-
In the Increase size field, specify the conditions for the actions below:
-
Storage expansion during the next maintenance window once the fill level exceeds the specified percentage. If you set this condition, configure the maintenance window schedule.
-
Storage expansion immediately once the fill level exceeds the specified percentage.
Warning
If you set both conditions, make sure the immediate expansion threshold is higher than the scheduled one.
-
-
Specify the maximum storage size after the expansion in the Maximum storage size field.
Warning
- You cannot decrease the storage size.
- When scaling your storage, the cluster hosts will be unavailable.
-
-
Host distribution across availability zones and subnets.
-
Number of hosts.
-
Public access to hosts.
-
-
Click Save.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To update the configuration of a host group, run this command:
yc managed-opensearch node-group update --cluster-name <cluster_name> \
--node-group-name <host_group_name> \
--resource-preset-id <host_class> \
--disk-size <disk_size_in_bytes> \
--hosts-count <number_of_hosts_in_group> \
--roles <host_roles>
Specify the required parameters in the command depending on the type of host group configuration you need:
-
--node-group-name: Name of the host group you need to update. -
--resource-preset-id: New host class. that defines the specifications of virtual machines the OpenSearch nodes will be deployed on. All available options are listed under Host classes. -
--disk-size: New disk size, in bytes. The minimum and maximum values depend on the selected host class. -
--hosts-count: New number of hosts in the group. -
--roles: New host roles. The possible values are:data: Assigns theDATArole only.manager: Assigns theMANAGERrole only.data+managerormanager+data: Assigns both roles.
-
Open the current Terraform configuration file describing your infrastructure.
To learn how to create this file, see Creating a cluster.
For a complete list of Managed Service for OpenSearch cluster configuration fields you can update, see this Terraform provider guide.
-
To update the configuration of an
OpenSearchhost group, edit the parameters of thenode_groupssection underopensearch:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... opensearch { ... node_groups { name = "<virtual_host_group_name>" assign_public_ip = <allow_public_access_to_hosts> hosts_count = <number_of_hosts> roles = ["<role_list>"] resources { resource_preset_id = "<host_class>" disk_size = <storage_size_in_bytes> disk_type_id = "<disk_type>" } } ... } }Where:
assign_public_ip: Public access to the host,trueorfalse.roles: Host roles,DATAandMANAGER.
-
To update the configuration of a
Dashboardshost group, edit thedashboardssection parameters:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... dashboards { node_groups { name = "<virtual_host_group_name>" assign_public_ip = <allow_public_access_to_hosts> hosts_count = <number_of_hosts> resources { resource_preset_id = "<host_class>" disk_size = <storage_size_in_bytes> disk_type_id = "<disk_type>" } } } }Where
assign_public_ipis public access to the host,trueorfalse. -
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
Timeouts
The Terraform provider sets the following timeouts for Managed Service for OpenSearch cluster operations:
- Creating a cluster, including by restoring it from a backup: 30 minutes.
- Updating a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the timeout are aborted.
How do I change these limits?
Add a
timeoutssection to the cluster description, e.g.:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... timeouts { create = "1h30m" # 1 hour 30 minutes update = "2h" # 2 hours delete = "30m" # 30 minutes } } -
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Create a file named
body.jsonand paste the following code into it:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
updateMaskparameter as a single comma-separated string.{ "updateMask": "resources,hostsCount,zoneIds,subnetIds,assignPublicIp,diskSizeAutoscaling", "nodeGroupSpec": { "resources": { "resourcePresetId": "<host_class>", "diskSize": "<storage_size_in_bytes>", "diskTypeId": "<disk_type>" }, "hostsCount": "<number_of_hosts>", "zoneIds": [ "<availability_zone_1>", "<availability_zone_2>", "<availability_zone_3>" ], "subnetIds": [ "<subnet_1_ID>", "<subnet_2_ID>", "<subnet_3_ID>" ], "assignPublicIp": <allow_public_access_to_hosts>, "diskSizeAutoscaling": { "plannedUsageThreshold": "<scheduled_expansion_percentage>", "emergencyUsageThreshold": "<immediate_expansion_percentage>", "diskSizeLimit": "<maximum_storage_size_in_bytes>" } } }Where:
-
updateMask: Comma-separated string of settings you want to update. -
nodeGroups: Host settings:-
resources: Cluster resources:resourcePresetId: Host class.diskSize: Disk size, in bytes.diskTypeId: Disk type.
-
hostsCount: Number of hosts in the group. The minimum number ofDATAandDashboardshosts is one; while the minimum number ofMANAGERhosts is three. -
zoneIds: List of availability zones the cluster hosts are located in. -
subnetIds: List of subnet IDs. -
assignPublicIp: Permission to connect to the host from the internet,trueorfalse. -
diskSizeAutoscaling: Automatic storage expansion settings:-
plannedUsageThreshold: Storage usage percentage to trigger a storage expansion during the next maintenance window.Use a value between
0and100%. The default value is0, i.e., automatic expansion is disabled.If you set this condition, configure the maintenance window schedule before creating your host group.
-
emergencyUsageThreshold: Storage usage percentage to trigger an immediate storage expansion.Use a value between
0and100%. The default value is0, i.e., automatic expansion is disabled.Warning
If you specify both thresholds,
emergencyUsageThresholdmust not be less thanplannedUsageThreshold. -
diskSizeLimit: Maximum storage size, in bytes, to set when storage usage reaches one of the specified thresholds.
Warning
- You cannot decrease the storage size.
- When scaling your storage, the cluster hosts will be unavailable.
-
-
-
-
To update an
OpenSearchhost group configuration:-
Call the Cluster.UpdateOpenSearchNodeGroup method, e.g., via the following cURL
request:curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/opensearch/node_groups/<host_group_name>' \ --data "@body.json"You can get the cluster ID with the list of clusters in the folder. You can get the name of the host group with cluster details.
-
View the server response to make sure your request was successful.
-
-
To update a
Dashboardshost group configuration:-
Call the Cluster.UpdateDashboardsNodeGroup method, e.g., via the following cURL
request:curl \ --request PATCH \ --header "Authorization: Bearer $IAM_TOKEN" \ --header "Content-Type: application/json" \ --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/dashboards/node_groups/<host_group_name>' \ --data "@body.json"You can get the cluster ID with the list of clusters in the folder. You can get the name of the host group with cluster details.
-
View the server response to make sure your request was successful.
-
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume that the repository contents reside in the
~/cloudapi/directory. -
Create a file named
body.jsonand paste the following code into it:Warning
The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the
update_maskparameter as an array ofpaths[]strings.Format for listing settings
"update_mask": { "paths": [ "<setting_1>", "<setting_2>", ... "<setting_N>" ] }{ "cluster_id": "<cluster_ID>", "name": "<host_group_name>", "update_mask": { "paths": [ "resources", "hosts_count", "zone_ids", "subnet_ids", "assign_public_ip" ] }, "node_group_spec": { "resources": { "resource_preset_id": "<host_class>", "disk_size": "<storage_size_in_bytes>", "disk_type_id": "<disk_type>" }, "hosts_count": "<number_of_hosts>", "zone_ids": [ "<availability_zone_1>", "<availability_zone_2>", "<availability_zone_3>" ], "subnet_ids": [ "<subnet_1_ID>", "<subnet_2_ID>", "<subnet_3_ID>" ], "assign_public_ip": <allow_public_access_to_hosts>, "disk_size_autoscaling": { "planned_usage_threshold": "<scheduled_expansion_percentage>", "emergency_usage_threshold": "<immediate_expansion_percentage>", "disk_size_limit": "<maximum_storage_size_in_bytes>" } } }Where:
-
update_mask: List of settings you want to update as an array of strings (paths[]). -
node_groups: Host settings:-
resources: Cluster resources:resource_preset_id: Host class.disk_size: Disk size, in bytes.disk_type_id: Disk type.
-
hosts_count: Number of hosts in the group. The minimum number ofDATAandDashboardshosts is one; while the minimum number ofMANAGERhosts is three. -
zone_ids: List of availability zones the cluster hosts are located in. -
subnet_ids: List of subnet IDs. -
assign_public_ip: Permission to connect to the host from the internet,trueorfalse. -
disk_size_autoscaling: Automatic storage expansion settings:-
planned_usage_threshold: Storage usage percentage to trigger a storage expansion during the next maintenance window.Use a value between
0and100%. The default value is0, i.e., automatic expansion is disabled.If you set this condition, configure the maintenance window schedule before creating your host group.
-
emergency_usage_threshold: Storage usage percentage to trigger an immediate storage expansion.Use a value between
0and100%. The default value is0, i.e., automatic expansion is disabled.Warning
If you specify both thresholds,
emergency_usage_thresholdmust not be less thanplanned_usage_threshold. -
disk_size_limit: Maximum storage size, in bytes, to set when storage usage reaches one of the specified thresholds.
Warning
- You cannot decrease the storage size.
- When scaling your storage, the cluster hosts will be unavailable.
-
-
-
-
To update an
OpenSearchhost group configuration:-
Call the ClusterService.UpdateOpenSearchNodeGroup method, e.g., via the following gRPCurl
request:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d @ \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.opensearch.v1.ClusterService.UpdateOpenSearchNodeGroup \ < body.jsonYou can get the cluster ID with the list of clusters in the folder. You can get the name of the host group with cluster details.
-
View the server response to make sure your request was successful.
-
-
To update a
Dashboardshost group configuration:-
Call the ClusterService.UpdateDashboardsNodeGroup method, e.g., via the following gRPCurl
request:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d @ \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.opensearch.v1.ClusterService.UpdateDashboardsNodeGroup \ < body.jsonYou can get the cluster ID with the list of clusters in the folder. You can get the name of the host group with cluster details.
-
View the server response to make sure your request was successful.
-
Deleting a host group
When deleting a host group, the following limitation applies: you cannot delete a single host group with the DATA role.
- In the management console
, navigate to the folder page. - Navigate to the Managed Service for OpenSearch service.
- Click the name of the cluster you need and select the
Node groups tab. - Click
in the row with the group you need and select Delete.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
To delete a host group, run this command:
yc managed-opensearch node-group delete --cluster-name <cluster_name> \
--node-group-name <host_group_name>
In the command, specify the host group you want to delete.
To delete a host group from a cluster:
-
Open the current Terraform configuration file describing your infrastructure.
To learn how to create this file, see Creating a cluster.
For a complete list of Managed Service for OpenSearch cluster configuration fields you can update, see this Terraform provider guide.
-
To delete an
OpenSearchhost group, remove itsnode_groupssection fromopensearch. -
To delete a
Dashboardshost group, remove thedashboardssection. -
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm deleting the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
Timeouts
The Terraform provider sets the following timeouts for Managed Service for OpenSearch cluster operations:
- Creating a cluster, including by restoring it from a backup: 30 minutes.
- Updating a cluster: 60 minutes.
- Deleting a cluster: 15 minutes.
Operations exceeding the timeout are aborted.
How do I change these limits?
Add a
timeoutssection to the cluster description, e.g.:resource "yandex_mdb_opensearch_cluster" "<cluster_name>" { ... timeouts { create = "1h30m" # 1 hour 30 minutes update = "2h" # 2 hours delete = "30m" # 30 minutes } } -
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
To delete an
OpenSearchhost group:-
Call the Cluster.DeleteOpenSearchNodeGroup method, e.g., via the following cURL
request:curl \ --request DELETE \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/opensearch/node_groups/<host_group_name>'You can get the cluster ID with the list of clusters in the folder. You can get the name of the host group with cluster details.
-
View the server response to make sure your request was successful.
-
-
To delete a
Dashboardshost group:-
Call the Cluster.DeleteDashboardsNodeGroup method, e.g., via the following cURL
request:curl \ --request DELETE \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/dashboards/node_groups/<host_group_name>'You can get the cluster ID with the list of clusters in the folder. You can get the name of the host group with cluster details.
-
View the server response to make sure your request was successful.
-
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume that the repository contents reside in the
~/cloudapi/directory. -
To delete an
OpenSearchhost group:-
Call the ClusterService.DeleteOpenSearchNodeGroup method, e.g., via the following gRPCurl
request:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "name": "<host_group_name>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.opensearch.v1.ClusterService.DeleteOpenSearchNodeGroupYou can get the cluster ID with the list of clusters in the folder. You can get the name of the host group with cluster details.
-
View the server response to make sure your request was successful.
-
-
To delete a
Dashboardshost group:-
Call the ClusterService.DeleteDashboardsNodeGroup method, e.g., via the following gRPCurl
request:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>", "name": "<host_group_name>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.opensearch.v1.ClusterService.DeleteDashboardsNodeGroupYou can get the cluster ID with the list of clusters in the folder. You can get the name of the host group with cluster details.
-
View the server response to make sure your request was successful.
-
Getting a list of cluster hosts
- In the management console
, navigate to the folder page. - Navigate to the Managed Service for OpenSearch service.
- Click the cluster name and select the
Hosts tab.
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Call the Cluster.ListHosts method, e.g., via the following cURL
request:curl \ --request GET \ --header "Authorization: Bearer $IAM_TOKEN" \ --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/hosts'You can get the cluster ID with the list of clusters in the folder.
-
View the server response to make sure your request was successful.
-
Get an IAM token for API authentication and put it in an environment variable:
export IAM_TOKEN="<IAM_token>" -
Clone the cloudapi
repository:cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapiBelow, we assume that the repository contents reside in the
~/cloudapi/directory. -
Call the ClusterService.ListHosts method, e.g., via the following gRPCurl
request:grpcurl \ -format json \ -import-path ~/cloudapi/ \ -import-path ~/cloudapi/third_party/googleapis/ \ -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \ -rpc-header "Authorization: Bearer $IAM_TOKEN" \ -d '{ "cluster_id": "<cluster_ID>" }' \ mdb.api.cloud.yandex.net:443 \ yandex.cloud.mdb.opensearch.v1.ClusterService.ListHostsYou can get the cluster ID with the list of clusters in the folder.
-
View the server response to make sure your request was successful.