Skip to content

Why does my OpenSearch Service domain upgrade take so long?

5 minute read
1

I'm trying to upgrade my Amazon OpenSearch Service domain, but the upgrade is taking a long time.

Short description

If you upgrade your OpenSearch Service domain version, then OpenSearch Service uses a blue/green deployment process to configure the changes. In a blue/green deployment, OpenSearch Service runs two production environments. One environment is live, and the other environment is idle. The two production environments switch according to software updates. OpenSearch Service creates a new environment during domain updates, and routes users to the new production environment after the updates complete.

The OpenSearch Service upgrade process consists of pre-upgrade checks for issues and a cluster snapshot to restore the cluster if the upgrade fails.

The following issues might occur with an OpenSearch Service upgrade:

  • Pre-upgrade check failures.
  • Upgrade process taking too long to complete.
  • Upgrade succeeded with issues.

Resolution

Pre-upgrade checks

The upgrade process can't be undone. Before you start an upgrade, it's a best practice to double-check eligibility because your domain might be ineligible for an upgrade, or fail to upgrade. You can't pause or cancel the upgrade process. During an upgrade, you can't make configuration changes to the domain.

For more information see, Troubleshooting an upgrade.

Check the snapshot status

Before a migration, OpenSearch Service takes an automated snapshot of your cluster when it passes the eligibility test. During a snapshot, the progress status might show Null or 0%. After OpenSearch Service takes the snapshot and updates the percentage value. The time it takes to complete a snapshot depends on the storage space. OpenSearch Service incrementally takes snapshots. If there are significant changes in your data from the previous automated snapshot, then your snapshot can take longer to complete.

Run the following API operation to retrieve running snapshots:

GET /_snapshot/_status

For more information about the snapshot APIs, see Monitor a snapshot on the Elasticsearch website.

Retrieve cluster snapshots and node IDs

To retrieve running snapshots in your cluster, run the following API operation:

GET /_snapshot/your-repository/_current

Note: Replace your-repository with your repository name.

To obtain the IDs of the data nodes, run the following API operation:

GET _cat/nodes

Use the node IDs to identify the nodes that are old or new. An increasing number of shards on the new nodes shows a smooth migration. Eventually, the shards move to the new nodes, and the old nodes become empty.

Monitor the blue/green deployment process

When your cluster enters the blue/green deployment process, the new nodes in the green environment appear. The shards are then migrated from the old nodes in the blue environment. After the data migration or shard reallocation completes, OpenSearch Service removes your old nodes.

Monitor new nodes

You can monitor the nodes cluster metric in Amazon CloudWatch to get the node count. Or, you can use the cat nodes API to list the nodes in your cluster:

GET /_cat/nodes?v&pretty

During this stage of the blue/green deployment process, you can view new nodes from the API output as the node count increases.

Data migration

You can run the CAT Allocation API operation to see how many shards are allocated to each node:

GET /_cat/allocation

For more information, see CAT Allocation API on the website.

To get shard status, run the following API operation:

GET _cat/shards?h=index,shard,prirep,state,relocating.reason

To check the recovery status of the shards in the cluster, run the following API operation:

GET _cat/recovery?active_only=true

For more information, see Get shard recovery information on the Elasticsearch website.

The data migration might take additional time to complete because of an overloaded cluster, unbalanced shards, or backend issues.

Overloaded cluster

Make sure that you upgrade the version when the cluster traffic isn't high. Before you begin the upgrade, check the CPUUtilization and JVMMemoryPressure cluster metrics to make sure that these metrics have optimal values.

For more information, see How do I troubleshoot high CPU utilization on my Amazon OpenSearch Service cluster?

Unbalanced shards

By default, OpenSearch Service has a sharding strategy of 5:1, where each index is divided into five primary shards. Set your sharding strategy size so that each one shards between 10-30 GiB for search workloads, or 30-50 GiB for logs workloads.

OpenSearch and Elasticsearch 7.x and later have a limit of 1,000 shards per node. It's a best practice to have a maximum of 25 shards per GiB of Java heap.

For more information, see How do I rebalance the uneven shard distribution in my Amazon OpenSearch Service cluster?

Backend issues

Shard migration can get stuck because of backend issues. If there's no progress with the migration and the issue doesn't self-resolve, then contact AWS Support.

Removal of old nodes

After the shards are migrated to the new nodes, OpenSearch Service removes older nodes from your cluster. The node count then returns to the original node count that you configured.

Upgrade succeeded with issues

If the cluster blocks incoming write requests, then you get the "upgrade succeeded with issues" message. Check the OpenSearch Service ClusterIndexWritesBlocked metric. A value of one means that the cluster blocks the write requests. To resolve this issue, add more disk space, or scale your cluster.

For more information, see Operational best practices for Amazon OpenSearch Service.

AWS OFFICIALUpdated 2 months ago