Excerpt |
---|
If you use Elasticsearch as search engine for yuuvis® Momentum, find here a reindex example procedure. |
Section | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Introduction
In case new requirements, either in terms of load capacity or functionality (ie.Eg., new supported languages), are introduced to a yuuvis® Momentum System system during production, it may become necessary to overhaul the backend Elasticsearch cluster by performing a Reindex reindex operation. The operation itself is slow and resource-intensiverequires a lot of resources, as it essentially creates a copy of the orignal original Elasticsearch Index index within the same Elasticsearch cluster, so 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 reindex entails the creation of a new Momentum-capable Indexindex, the migration of Elasticsearch data from the original Index index into said new Indexindex, and finally the removal of the old Indexindex. These steps are achieved by interaction with the Elasticsearch API, which is exposed by Elasticsearch through Port port 9200 on elected Master Nodesselected master nodes. It 's is highly recommended to create an Elasticsearch snapshot using the same API before attempting the Reindexreindex.
Below, you can find a detailed overview of the CURL commands needed to successfully perform a Reindex reindex in yuuvis® Momentum. Note that all commands assume you have port-forwarded the ElasticSearch API to http:\\localhost:9200.
...
Creating a Momentum-Capable Elasticsearch Index
Two steps are required to create an Elasticsearch Index index that can interact with yuuvis® Momentum:1. Creating
- Creation of a new Elasticsearch index, and
Applying yuuvis® Momentum Elasticsearch index mapping and settings
Creating a new Elasticsearch Index
A new index needs to be created to fit match the specifications of the new requirements.
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
Create a new Index with a unique name. The creation of the new elasticsearch Elasticsearch index allows for the optimization of the working Index 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 50GB 50 GB of Elasticsearch data, a high-performance Index index might look something like this:
Make sure to change the Index index parameters to suit your storage and reliability requirements. |
...
Applying yuuvis® Momentum Elasticsearch Index Mapping and Settings
The yuuvis® Momentum services require Elasticsearch to use a custom mapping. Using ElasticsearchsElasticsearch's automatic mapping algorithm for reindexing renders the new index unusable for the yuuvis® Momentum Systemsystem.
Expand | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
To get a compatible mapping, one can retrieve the original Elasticsearch Indexsindex's mapping through use of by using the Get mapping API:
Then apply the extracted Mapping mapping the new Indexindex
You Optionally, you can also optionally base the new Indexindex' settings on the orignal original configuration:
|
...
Migrating the Data to the new Index
Once a compatible Index index has been created, the Reindex reindex operation can be triggered through the Elasticsearch API.
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
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 has is completed, the new Index index must be activated by reassigning the 'yuuvis' alias from the old Index to the new yuuvis
alias.
Expand | |||||||
---|---|---|---|---|---|---|---|
| |||||||
The new index needs to inherit the
|
...
Deleting the
...
Original Index
To free up space in the Elasticsearch Clustercluster, it 's is sensible to remove the original Index index after verifying the yuuvis® Momentum system has accepted the new Indexindex.
Expand | ||||
---|---|---|---|---|
| ||||
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html Code Block | | |||
|
Code Block | ||
---|---|---|
| ||
curl -X DELETE "localhost:9200/yuuvis_1" |
Info | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||
Read on
|