On 10/15/2013 12:36 PM, Christopher Gross wrote:
In Solr 3.x, whenever I'd reindex content, I'd fill up one instance, copy
the whole "data" directory over to the second (or third) instance and then
restart that Tomcat to get the indexes lined up.

With Solr 4.1, I'm guessing that I can't go and do that without taking down
all of my nodes and making the replacement.  I've yet to see any
documentation on "best practices" to switch indexes in a SolrCloud
environment -- can anyone out there share what they've done to get it to
work?

I've tried to stand up the "new" index using the Admin UI, but I just get
errors when trying to create the new index with the new directory (which
does have a copy of the conf & data dirs.)

The first thing to say is that it's likely you could do exactly what you did in 3.x in 4.x, if you don't bring SolrCloud into it.

SolrCloud may offer you two slightly different paths that wouldn't require restarts.

1) Use the alias feature. If you want to send queries to "mycollection", then you can index your data into a collection called "mycollection_20131015". When the new index is ready, ask Solr to create an alias from "mycollection" to the collection you've just created, then you can delete the old collection at your leisure. The collection can live on any or all nodes in your SolrCloud.

http://wiki.apache.org/solr/SolrCloud#Collection_Aliases

2) You could create a core on your other instance that's a replica of the collection shard you're interested in. SolrCloud should replicate the index over automatically. Once it's replicated and everything is in sync, you could unload the core on the original instance, with the option to delete the instanceDir. SOLR-5317 may be a worry if you're running 4.5.0, you'd want to wait for 4.5.1 before trying it if you happen to be running that version.You mentioned Solr 4.1, so that particular bug shouldn't be a factor, but with a version that old, you may run into other problems that have since been fixed.

Thanks,
Shawn

Reply via email to