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 Rohit Harchandani <rh...@gmail.com> on 2012/08/14 23:57:21 UTC

Update data directory at run time

Hi All,
I am new to Solr and would really appreciate some help on this issue.
I have a single core setup currently and have separate instances for
querying and indexing. These two instances point to different data
directories through symbolic links since I do not want it to affect the
"live" searching instance.
Once the indexing is done, I swap the directories to which the symbolic
links point, so that the "live" searching instance now points to the
directory where the new data was indexed. But this does not seem to work,
without restarting solr.
I guess my purpose can probably be acheived using multiple cores and
SWAP(?), but wanted to know if there is a way to do this with a single
core? Is there some command needed once the directories are swapped?
I see in the core description, that the "directory" entry under "index" did
not change after updating the symlinks.

(org.apache.lucene.store.MMapDirectory:org.apache.lucene.store.MMapDirectory@/bb/mbigd/mbig2580/srchSolr/apache-solr-4.0.0-ALPHA/example/solr/data/index
lockFactory=org.apache.lucene.store.NativeFSLockFactory@2447e380)

Is there a way to update this dynamically? Thanks a lot

Regards,
Rohit Harchandani

Re: Update data directory at run time

Posted by Walter Underwood <wu...@wunderwood.org>.
It will download all changed files on disk. This might be the entire index. If the download succeeds, it will switch to the new index with no downtime.

Usually, search is a bit slower for a few minutes because it is starting with new caches.

wunder

On Aug 14, 2012, at 3:32 PM, Rohit Harchandani wrote:

> Cool. Thanks. I will have a look at this.
> But in this case, if all the files on the master are new, will the entire
> index on the slave be replaced or will it add to whatever is currently
> present on the slave?
> Thanks again,
> Rohit
> 
> On Tue, Aug 14, 2012 at 6:04 PM, Walter Underwood <wu...@wunderwood.org>wrote:
> 
>> Why are you not using the built-in replication? That works fine. You do
>> not need to invent anything.
>> 
>> wunder
>> 
>> On Aug 14, 2012, at 2:57 PM, Rohit Harchandani wrote:
>> 
>>> Hi All,
>>> I am new to Solr and would really appreciate some help on this issue.
>>> I have a single core setup currently and have separate instances for
>>> querying and indexing. These two instances point to different data
>>> directories through symbolic links since I do not want it to affect the
>>> "live" searching instance.
>>> Once the indexing is done, I swap the directories to which the symbolic
>>> links point, so that the "live" searching instance now points to the
>>> directory where the new data was indexed. But this does not seem to work,
>>> without restarting solr.
>>> I guess my purpose can probably be acheived using multiple cores and
>>> SWAP(?), but wanted to know if there is a way to do this with a single
>>> core? Is there some command needed once the directories are swapped?
>>> I see in the core description, that the "directory" entry under "index"
>> did
>>> not change after updating the symlinks.
>>> 
>>> 
>> (org.apache.lucene.store.MMapDirectory:org.apache.lucene.store.MMapDirectory@
>> /bb/mbigd/mbig2580/srchSolr/apache-solr-4.0.0-ALPHA/example/solr/data/index
>>> lockFactory=org.apache.lucene.store.NativeFSLockFactory@2447e380)
>>> 
>>> Is there a way to update this dynamically? Thanks a lot
>>> 
>>> Regards,
>>> Rohit Harchandani





Re: Update data directory at run time

Posted by Rohit Harchandani <rh...@gmail.com>.
Cool. Thanks. I will have a look at this.
But in this case, if all the files on the master are new, will the entire
index on the slave be replaced or will it add to whatever is currently
present on the slave?
Thanks again,
Rohit

On Tue, Aug 14, 2012 at 6:04 PM, Walter Underwood <wu...@wunderwood.org>wrote:

> Why are you not using the built-in replication? That works fine. You do
> not need to invent anything.
>
> wunder
>
> On Aug 14, 2012, at 2:57 PM, Rohit Harchandani wrote:
>
> > Hi All,
> > I am new to Solr and would really appreciate some help on this issue.
> > I have a single core setup currently and have separate instances for
> > querying and indexing. These two instances point to different data
> > directories through symbolic links since I do not want it to affect the
> > "live" searching instance.
> > Once the indexing is done, I swap the directories to which the symbolic
> > links point, so that the "live" searching instance now points to the
> > directory where the new data was indexed. But this does not seem to work,
> > without restarting solr.
> > I guess my purpose can probably be acheived using multiple cores and
> > SWAP(?), but wanted to know if there is a way to do this with a single
> > core? Is there some command needed once the directories are swapped?
> > I see in the core description, that the "directory" entry under "index"
> did
> > not change after updating the symlinks.
> >
> >
> (org.apache.lucene.store.MMapDirectory:org.apache.lucene.store.MMapDirectory@
> /bb/mbigd/mbig2580/srchSolr/apache-solr-4.0.0-ALPHA/example/solr/data/index
> > lockFactory=org.apache.lucene.store.NativeFSLockFactory@2447e380)
> >
> > Is there a way to update this dynamically? Thanks a lot
> >
> > Regards,
> > Rohit Harchandani
>
>
>
>
>
>

Re: Update data directory at run time

Posted by Walter Underwood <wu...@wunderwood.org>.
Why are you not using the built-in replication? That works fine. You do not need to invent anything.

wunder

On Aug 14, 2012, at 2:57 PM, Rohit Harchandani wrote:

> Hi All,
> I am new to Solr and would really appreciate some help on this issue.
> I have a single core setup currently and have separate instances for
> querying and indexing. These two instances point to different data
> directories through symbolic links since I do not want it to affect the
> "live" searching instance.
> Once the indexing is done, I swap the directories to which the symbolic
> links point, so that the "live" searching instance now points to the
> directory where the new data was indexed. But this does not seem to work,
> without restarting solr.
> I guess my purpose can probably be acheived using multiple cores and
> SWAP(?), but wanted to know if there is a way to do this with a single
> core? Is there some command needed once the directories are swapped?
> I see in the core description, that the "directory" entry under "index" did
> not change after updating the symlinks.
> 
> (org.apache.lucene.store.MMapDirectory:org.apache.lucene.store.MMapDirectory@/bb/mbigd/mbig2580/srchSolr/apache-solr-4.0.0-ALPHA/example/solr/data/index
> lockFactory=org.apache.lucene.store.NativeFSLockFactory@2447e380)
> 
> Is there a way to update this dynamically? Thanks a lot
> 
> Regards,
> Rohit Harchandani