1
votes

I am new to the Master/Slave configuration in Solr and am trying to understand what the replicateAfter attribute in the master slave configuration of solr means. I initially thought that after a commit/optimize, the master would send the updates to all the slaves. But it doesn't seem to be the case.

Here is the request handler configuration for replicate.

<requestHandler name="/replication" class="solr.ReplicationHandler" >
  <lst name="master">
    <str name="enable">${enable.master:false}</str>
    <str name="replicateAfter">commit</str>
    <str name="replicateAfter">startup</str>
     <str name="replicateAfter">optimize</str>
    <str name="confFiles">schema.xml,stopwords.txt</str>
 </lst>
 <lst name="slave">
    <str name="enable">${enable.slave:false}</str>
    <str name="masterUrl">http://${MASTER_CORE_URL}/${solr.master.core.name}/replication</str>
    <str name="pollInterval">${POLL_TIME}</str>
 </lst>

The slave seems to get the updates after the poll Interval. But my requirement is to have the indexes of slaves updated immediately after a commit/optimize to the Master. Can the Master communicate to the slaves on a commit/optimize? Or is the communication only one way from the slave to the Master? Can someone please help answer these questions? Thanks!

2

2 Answers

5
votes

So, Here is the Answer. ReplicateAfter tells Master when to make new versions of index available for when slaves asks for updates (Thanks to raticulin for answering it!)

2
votes

Slaves poll the master continuously, master does non initiate any communication with slaves. You should just lower ${POLL_TIME} enough so replication will happen very fast after commit on master.