I was wondering how one would go about duplicating an index into another on
the same cluster. I know you can probably write code to scan and reindex,
but is that the only way? Is there some feature in ES that facilitates
this kind of thing? I'm on 0.19.7.
I was wondering how one would go about duplicating an index into another on the same cluster. I know you can probably write code to scan and reindex, but is that the only way? Is there some feature in ES that facilitates this kind of thing? I'm on 0.19.7.
Hi Rafal,
Thanks for the suggestion, but I don't want to copy to another cluster.
I want an identical index with a different name but with all the data
intact on the SAME cluster.
-- KJ
On Sunday, November 4, 2012 10:14:06 AM UTC-8, Rafał Kuć wrote:
I was wondering how one would go about duplicating an index into another
on the same cluster. I know you can probably write code to scan and
reindex, but is that the only way? Is there some feature in ES that
facilitates this kind of thing? I'm on 0.19.7.
In that case, the following should work for a single node:
If you have more nodes, you'd only have to "copy" metadata once for
the whole cluster, then stop all nodes, copy the shards and start all
the nodes again.
All this assumes you have and ES version of at least 0.19.8 and you
have the default setting of gateway.local.auto_import_dangled: true
Hi Rafal,
Thanks for the suggestion, but I don't want to copy to another cluster. I want an identical index with a different name but with all the data intact on the SAME cluster.
-- KJ
On Sunday, November 4, 2012 10:14:06 AM UTC-8, Rafał Kuć wrote:
I was wondering how one would go about duplicating an index into another on the same cluster. I know you can probably write code to scan and reindex, but is that the only way? Is there some feature in ES that facilitates this kind of thing? I'm on 0.19.7.
Wow, great script, Radu. As I said though, I am on 0.19.7. Are there any
features I need in 0.19.8 that will prevent me from using this script on
0.19.7?
If you have more nodes, you'd only have to "copy" metadata once for
the whole cluster, then stop all nodes, copy the shards and start all
the nodes again.
All this assumes you have and ES version of at least 0.19.8 and you
have the default setting of gateway.local.auto_import_dangled: true
Hi Rafal,
Thanks for the suggestion, but I don't want to copy to another
cluster. I want an identical index with a different name but with all the
data intact on the SAME cluster.
-- KJ
On Sunday, November 4, 2012 10:14:06 AM UTC-8, Rafał Kuć wrote:
I was wondering how one would go about duplicating an index into
another on the same cluster. I know you can probably write code to scan
and reindex, but is that the only way? Is there some feature in ES that
facilitates this kind of thing? I'm on 0.19.7.
Sorry, I got lost in my own thoughts :(. Although I didn't test it on
0.19.7, it should work.
My initial approach would have been to copy the data directory of the
"old" index to a "new" directory and restart Elasticsearch. Then,
Elasticsearch would have seen the "new" directory as a dangled index
and try to import it. And you would need 0.19.8 to import those
dangled indices.
But I couldn't actually copy an index this way, so that's why I went
on the path of simply reposting the same metadata in the new index,
and copying the shards themselves when ES is offline. That seems to
work, and it has nothing to do with dangled indices. So it should work
for 0.19.7 as well.
I would suggest to try this option in a test environment and post here
if you have any trouble.
Wow, great script, Radu. As I said though, I am on 0.19.7. Are there any
features I need in 0.19.8 that will prevent me from using this script on
0.19.7?
If you have more nodes, you'd only have to "copy" metadata once for
the whole cluster, then stop all nodes, copy the shards and start all
the nodes again.
All this assumes you have and ES version of at least 0.19.8 and you
have the default setting of gateway.local.auto_import_dangled: true
Hi Rafal,
Thanks for the suggestion, but I don't want to copy to another
cluster. I want an identical index with a different name but with all the
data intact on the SAME cluster.
-- KJ
On Sunday, November 4, 2012 10:14:06 AM UTC-8, Rafał Kuć wrote:
I was wondering how one would go about duplicating an index into
another on the same cluster. I know you can probably write code to scan and
reindex, but is that the only way? Is there some feature in ES that
facilitates this kind of thing? I'm on 0.19.7.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.