Jump to content

Search/Elasticsearch Administration/Migrating Between Major Versions

From Wikitech

Migrating Between Major Opensearch (or Elasticsearch) Versions HOWTO*

*For Search Platform-owned Opensearch installations at the WMF

  1. Check for indices with zero replicas. During the reindexing process, we create an empty index which will contain the new index. When reindexing is complete, the index will be promoted (in other words, it will be aliased to the wiki's index name.

To find indices with zero replicas:

 REQUEST: 
 curl -s https://${EP}/_cat/indices | awk '$6 == 0 { print $0 }'
 
 RESPONSE: 
 green open enwiki_content_1727943601        VgDeZAUsTXevwdKzsyyGXA 21 0 123151759        0  649.3gb  649.3gb


You can check which index is current via the _cat/aliases API route:

REQUEST: 
curl -s ${EP}/_cat/aliases | grep enwiki
RESPONSE:
enwiki                 enwiki_content_1716518626         - - - -

In this example, the value of the zero-replicated index (enwiki_content_1727943601) doesn't match the current index for that enwiki (which is enwiki_content_1716518626). That means the zero-replica index from our first API call ( enwiki_content_1716518626 ) is safe to delete.

2. Delete the zero-replica indices

3. Ban the node you're about to reimage Be sure to wait for it to drain all its shards on all its clusters!

4. Reimage the node

5.