You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by schmax <ma...@gmail.com> on 2010/03/16 16:57:19 UTC

Switching data dir on the fly

I generate solr index on an hadoop cluster and I want to copy it from HDFS to
a server running solr.

I wish to copy the index on a different disk than the disk that solr
instance is using, then tell the solr server to switch from the current data
dir to the location where I copied the hadoop generated index (without
having search service interruptions).

Is it possible? Anyone has a better solution?

Thanks
-- 
View this message in context: http://old.nabble.com/Switching-data-dir-on-the-fly-tp27920425p27920425.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Switching data dir on the fly

Posted by Chris Hostetter <ho...@fucit.org>.
: I wish to copy the index on a different disk than the disk that solr
: instance is using, then tell the solr server to switch from the current data
: dir to the location where I copied the hadoop generated index (without
: having search service interruptions).

One way to do this would be to CREATE a new SolreCore pointed at the new 
directory, and then use the SWAP command to replace the old core with the 
new one...

	http://wiki.apache.org/solr/CoreAdmin

...this can all be done with a live Solr instance, w/o ever needing to 
interupt existing service.

That siad: there may also be a way to do this with a single SolrCore -- 
the ReplicationHandler pulls snapshots from a master into a new directory, 
and then tells the SolrCore to change it's index directory (allowing it to 
do cache warming against the new index based on the cache keys from the 
old index -- something that's not possible with SolrCore SWAPing) ... I'm 
not sure off the top of my head how ReplicationHandler does this, but 
there must be a java hook for it somewhere, so you could probably 
generalize it into a command that lets you start using an arbitrary 
directory.

: Is it possible? Anyone has a better solution?

You might see if you can extend the ReplicationHandler to pull from HDFS?


-Hoss