-
Notifications
You must be signed in to change notification settings - Fork 1
documentation for ES reindexing #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Veki301
wants to merge
1
commit into
main
Choose a base branch
from
WPB-21670-docs-for-es-reindex
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,6 +91,109 @@ This is the command to list the nodes in the cluster: | |
| ssh <ip of elasticsearch node> curl 'http://localhost:9200/_cat/nodes?v&h=id,ip,name' | ||
| ``` | ||
|
|
||
| ## How to recreate ES index | ||
|
|
||
| Charts for `elasticsearch-migrate` will be needed: | ||
|
|
||
| ``` | ||
| wget wget https://s3-eu-west-1.amazonaws.com/public.wire.com/charts-develop/elasticsearch-migrate-0.1.0.tgz | ||
| ``` | ||
|
|
||
| Create a `values.yaml` to configure it: | ||
|
|
||
| ``` | ||
| reindexType: "reindex" | ||
| runReindex: false | ||
| elasticsearch: | ||
| host: # your elasticsearch host here | ||
| index: directory_new | ||
| cassandra: | ||
| host: # your cassandra host here | ||
| image: | ||
| tag: 5.23.0 # or whichever version you are running atm, the current method has been tested with 5.23 and 5.25 | ||
| ``` | ||
|
|
||
| This will create a new index called `directory_new` after it has been run. | ||
|
|
||
| Run it with helm (mind the following cmd assumes some paths which might not be applicable in your installation): | ||
|
|
||
| ``` | ||
| helm upgrade --install elasticsearch-migrate charts/elasticsearch-migrate -f values/elasticsearch-migrate/values.yaml | ||
| ``` | ||
|
|
||
| Configure brig to use both the standard and the newly created index (usually in `values/wire-server/values.yaml`): | ||
|
|
||
| ``` | ||
| brig: | ||
| config: | ||
| elasticsearch: | ||
| host: elasticsearch-external | ||
| index: directory | ||
| additionalWriteIndex: directory_new | ||
| ``` | ||
|
|
||
| Apply it (same assumptions regarding paths as our standard deployment process): | ||
|
|
||
| ``` | ||
| helm upgrade --install wire-server charts/wire-server -f values/wire-server/values.yaml -f values/wire-server/values.yaml | ||
| ``` | ||
|
|
||
| To backfill the new index, edit `values.yaml` for `elasticsearch-migrate` charts and set `runReindex` to true: | ||
|
|
||
| ``` | ||
| reindexType: "reindex" | ||
| runReindex: true | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could not find any references of both |
||
| elasticsearch: | ||
| host: # your elasticsearch host here | ||
| index: directory_new | ||
| cassandra: | ||
| host: # your cassandra host here | ||
| image: | ||
| tag: 5.23.0 # or whichever version you are running atm, the current method has been tested with 5.23 and 5.25 | ||
| ``` | ||
|
|
||
| Apply it again: | ||
|
|
||
| ``` | ||
| helm upgrade --install elasticsearch-migrate charts/elasticsearch-migrate -f elasticsearch-migrate/values.yaml | ||
| ``` | ||
|
|
||
| This should start a kubernetes `Job` named `elasticsearch-migrate-data` that might take several hours to run, depending on the amount of data it needs to re-create. | ||
| Galley pods might get OOMKilled during this, if that is the case, increase galley memory for requests and limits (we found in Wire Cloud prod 8Gi is sufficient): | ||
|
|
||
| ``` | ||
| galley: | ||
| resources: | ||
| requests: | ||
| memory: 8Gi | ||
| limits: | ||
| memory: 8Gi | ||
| ``` | ||
|
|
||
| Reapply: | ||
|
|
||
| ``` | ||
| helm upgrade --install wire-server charts/wire-server -f values/wire-server/values.yaml -f values/wire-server/values.yaml | ||
| ``` | ||
|
|
||
| And then restart `elasticsearch-migrate`. | ||
|
|
||
| After the reindexing is complete, configure wire-server to read from the new index: | ||
|
|
||
| ``` | ||
| brig: | ||
| config: | ||
| elasticsearch: | ||
| index: directory_new | ||
| elasticsearch-index: | ||
| elasticsearch: | ||
| index: directory_new | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also did not find any reference of this value |
||
| ``` | ||
|
|
||
| After verifying all is okay on the client side (check your Team Settings UI, if you can see your team user list). You can delete the old index in your ES cluster with: | ||
|
|
||
| curl -X DELETE “localhost:9200/directory” | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| Description: | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this specific image? What about the chart image?