If you use Elasticsearch as search engine for yuuvis® Momentum, find here a reindex example procedure. |
|
In case new requirements, either in terms of load capacity or functionality (e.g., new supported languages), are introduced to a yuuvis® Momentum system during production, it may become necessary to overhaul the backend Elasticsearch cluster by performing a reindex operation. The operation itself is slow and requires a lot of resources, as it essentially creates a copy of the original Elasticsearch index within the same Elasticsearch cluster, to make sure enough storage space is available and to optionally create more data nodes which can be shut down after the operation.
An Elasticsearch reindex entails the creation of a new Momentum-capable index, the migration of Elasticsearch data from the original index into said new index, and finally the removal of the old index. These steps are achieved by interaction with the Elasticsearch API, which is exposed by Elasticsearch through port 9200 on selected master nodes. It is highly recommended to create an Elasticsearch snapshot using the same API before attempting the reindex.
Below, you can find a detailed overview of the CURL commands needed to successfully perform a reindex in yuuvis® Momentum. Note that all commands assume you have port-forwarded the ElasticSearch API to http:\\localhost:9200.
Two steps are required to create an Elasticsearch index that can interact with yuuvis® Momentum:
Applying yuuvis® Momentum Elasticsearch index mapping and settings
A new index needs to be created to match the specifications of the new requirements.
Create a new Index with a unique name. The creation of the new Elasticsearch index allows for the optimization of the working index for the current storage requirements. Indices work best when storing around 10 GB, and should contain no more than 50 GB of data. For a cluster than contains 50 GB of Elasticsearch data, a high-performance index might look something like this:
Make sure to change the index parameters to suit your storage and reliability requirements. |
The yuuvis® Momentum services require Elasticsearch to use a custom mapping. Using Elasticsearch's automatic mapping algorithm for reindexing renders the new index unusable for the yuuvis® Momentum system.
To get a compatible mapping, retrieve the original Elasticsearch index's mapping by using the Get mapping API:
Then apply the extracted mapping the new index
Optionally, you can also base the new index' settings on the original configuration:
|
Once a compatible index has been created, the reindex operation can be triggered through the Elasticsearch API.
The reindex operation itself provides a few options for configuration. For large data volumes especially, we employ parameters that increase stability and performance of the operation, such as the
|
After the reindex is completed, the new index must be activated by reassigning the yuuvis
alias.
The new index needs to inherit the
|
To free up space in the Elasticsearch cluster, it is sensible to remove the original index after verifying the yuuvis® Momentum system has accepted the new index.
Make sure that the yuuvis® Momentum system still functions properly and contains all expected data before proceeding with the deletion of the original index.
|
Read on
|