Spec-Zone.ru › Elasticsearch 7
›Elasticsearch Guide [7.17] ›Upgrade Elasticsearch ›Reindex before upgrading

Reindex in place

You can use the Upgrade Assistant in Kibana 6.8 to automatically reindex 5.x indices you need to carry forward to 7.17.28.

To manually reindex your old indices in place:

  1. Create an index with 7.x compatible mappings.
  2. Set the refresh_interval to -1 and the number_of_replicas to 0 for efficient reindexing.
  3. Use the reindex API to copy documents from the 5.x index into the new index. You can use a script to perform any necessary modifications to the document data and metadata during reindexing.
  4. Reset the refresh_interval and number_of_replicas to the values used in the old index.
  5. Wait for the index status to change to green.
  6. In a single aliases API request:

    1. Delete the old index.
    2. Add an alias with the old index name to the new index.
    3. Add any aliases that existed on the old index to the new index.

If you use machine learning features and your machine learning indices were created before 6.x, you must temporarily halt the tasks associated with your machine learning jobs and datafeeds and prevent new jobs from opening during the reindex. Use the set upgrade mode API or stop all datafeeds and close all machine learning jobs.

If you use Elasticsearch security features, before you reindex .security* internal indices it is a good idea to create a temporary superuser account in the file realm.

  1. On a single node, add a temporary superuser account to the file realm. For example, run the elasticsearch-users useradd command:

    bin/elasticsearch-users useradd <user_name> \
    -p <password> -r superuser
  2. Use these credentials when you reindex the .security* index. That is to say, use them to log in to Kibana and run the Upgrade Assistant or to call the reindex API. You can use your regular administration credentials to reindex the other internal indices.
  3. Delete the temporary superuser account from the file realm. For example, run the elasticsearch-users userdel command:

    bin/elasticsearch-users userdel <user_name>

For more information, see File-based user authentication.

© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/reindex-upgrade-inplace.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API