Skip to content

Should reindex-from-remote allow indexing lots of indices into local indexes with the same name? #22920

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

Closed
nik9000 opened this issue Feb 2, 2017 · 7 comments
Labels
:Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >docs General docs changes

Comments

@nik9000
Copy link
Member

nik9000 commented Feb 2, 2017

Right now reindex-from-remote only indexes into a single destination index by default. You can use this technique to make it write into indices with a different name, but you can't get it to write into exactly the same index name. The script doesn't support that. Should we do something to make reindex-from-remote support writing to the same target indexes?

@nik9000
Copy link
Member Author

nik9000 commented Feb 2, 2017

Personally I wouldn't want to use this feature. If I had many indices that I wanted to reindex-from-remote I'd write a bash script to reindex them one by one. That way I could see progress and parallelize them or whatever. I've been known to write some pretty fancy (still horrible) bash scripts for this kind of thing....

@clintongormley
Copy link
Contributor

I like the ease of use of reindexing all indices to a new cluster, but I think i'm persuaded by your argument:

If I had many indices that I wanted to reindex-from-remote I'd write a bash script to reindex them one by one. That way I could see progress and parallelize them or whatever.

@nik9000
Copy link
Member Author

nik9000 commented Feb 3, 2017

Talked with a small group - I'll update the docs with the bash script I'd write.

@nik9000 nik9000 added >docs General docs changes and removed discuss labels Feb 3, 2017
@ruflin
Copy link
Contributor

ruflin commented Jul 11, 2017

@nik9000 Did the bash script end up in the docs?

The use case we just had for this is migrating a local Elasticsearch cluster with daily indices to Elastic Cloud. I personally think there would be value in making this use case as simple as possible and not require an external script to work.

What is the reason the script works with a new index but fails with the exact same one?

@nik9000
Copy link
Member Author

nik9000 commented Jul 11, 2017

@nik9000 Did the bash script end up in the docs?

No. I forgot about this issue.

The nice thing about an external script is that it can be made to be fairly pause-able and resume-able, both of which are harder with reindex.

If you want to dump many external indices into the same target index that'll work. But reindex doesn't have a "same_as_source" option. You can use a script to get it, but I figure if you are loading many indices you are better of doing it with something you have more control over.

@dpavlos
Copy link

dpavlos commented Sep 6, 2017

Hi there,

in case anyone else stumble upon this, here is a very simple python script I've used to migrate our ES to v5. The script pretty much follows @nik9000 idea.

@lcawl lcawl added :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. and removed :Reindex API labels Feb 13, 2018
@bleskes
Copy link
Contributor

bleskes commented May 22, 2018

@nik9000 are you still planning to do this? if not, it's fine. Please close the issue.

nik9000 added a commit to nik9000/elasticsearch that referenced this issue Jun 12, 2018
Folks tend to want to be able to make a single `_reindex` call to
migrate many indices. You *can* do that and we even have an example of
how to do that in the docs but it isn't always a good idea. This change
adds some advice to the docs: generally you want to make one reindex
call per index.

Closes elastic#22920
nik9000 added a commit that referenced this issue Jun 19, 2018
Folks tend to want to be able to make a single `_reindex` call to
migrate many indices. You *can* do that and we even have an example of
how to do that in the docs but it isn't always a good idea. This change
adds some advice to the docs: generally you want to make one reindex
call per index.

Closes #22920
nik9000 added a commit that referenced this issue Jun 19, 2018
Folks tend to want to be able to make a single `_reindex` call to
migrate many indices. You *can* do that and we even have an example of
how to do that in the docs but it isn't always a good idea. This change
adds some advice to the docs: generally you want to make one reindex
call per index.

Closes #22920
nik9000 added a commit that referenced this issue Jun 19, 2018
Folks tend to want to be able to make a single `_reindex` call to
migrate many indices. You *can* do that and we even have an example of
how to do that in the docs but it isn't always a good idea. This change
adds some advice to the docs: generally you want to make one reindex
call per index.

Closes #22920
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >docs General docs changes
Projects
None yet
Development

No branches or pull requests

6 participants