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 Ryan Kennedy <rc...@gmail.com> on 2009/12/22 18:30:24 UTC

adding a new slave doesn't trigger replication until the master index rebuilds

I'm trying to automate setting up new slave instances. I've noticed
when I use the core admin to bring a new slave core online that the
slave won't replicate the master index. The issue appears to be that
when the slave core is created, it's given a new (empty) index with a
newer timestamp than the master index timestamp. When the master
finally reindexes, only then does the slave replicate.

Short of triggering a reindex on the master, how can I get the newly
created slave core to do replication? To create the slave core, I
execute the following shell script:

curl "http://localhost:8080/solr/admin/cores?action=CREATE&name=slave0&instanceDir=solrhome/slave0&config=solrhome/slave0/conf/solrconfig.xml&schema=solrhome/slave0/conf/schema.xml&dataDir=solrhome/slave0/data"
curl "http://localhost:8080/solr/slave0/replication?command=fetchindex&masterUrl=http://localhost:8080/solr/master/replication"
curl "http://localhost:8080/solr/slave0/replication?command=enablepoll"

Ryan

Re: adding a new slave doesn't trigger replication until the master index rebuilds

Posted by Ryan Kennedy <rc...@gmail.com>.
On Tue, Dec 22, 2009 at 9:30 AM, Ryan Kennedy <rc...@gmail.com> wrote:
> I'm trying to automate setting up new slave instances. I've noticed
> when I use the core admin to bring a new slave core online that the
> slave won't replicate the master index. The issue appears to be that
> when the slave core is created, it's given a new (empty) index with a
> newer timestamp than the master index timestamp. When the master
> finally reindexes, only then does the slave replicate.

Figured it out, I needed to add "startup" to the "replicateAfter" for
this particular use case (I had tried adding the new core after
restarting the master):

    <str name="replicateAfter">startup</str>

Ryan