Skip to content
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

zero downtime importing #438

Closed
pseidemann opened this issue Jul 9, 2015 · 2 comments
Closed

zero downtime importing #438

pseidemann opened this issue Jul 9, 2015 · 2 comments

Comments

@pseidemann
Copy link

hello,
currently when I do Model.import (elasticsearch-model), the whole index will be wiped out and then rewritten. this method is not an option when the system is live. I would need to shutdown all clients somehow before doing the import.
because of this I would propose to implement a zero downtime method like searchkick did (see https://github.com/ankane/searchkick/blob/master/lib/searchkick/index.rb#L151). their method Model.reindex calls the method reindex_scope which creates a new index with the current timestamp as a suffix, fills this index, and then changes the index alias to this newly created index.
what do you think?

@karmi
Copy link
Contributor

karmi commented Jul 9, 2015

There's probably an issue opened for that already... I'm not sure how much "magic" to provide, because:

(...) the whole index will be wiped out and then rewritten (...)

Not really -- the method is much more flexible and allows to (re)index into a completely different index. Then it's mostly a matter of setting up aliases and so on so everything adds up.

@pseidemann
Copy link
Author

I think #234 is related.
I can't find anything about managing aliases in the elasticsearch-rails documentation.
from my perspective, implementing this "magic" has great value. it is even recommended by the elastic blog itself https://www.elastic.co/blog/changing-mapping-with-zero-downtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants