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 Pulkit Singhal <pu...@gmail.com> on 2011/09/10 21:54:18 UTC

Re: Replication setup with SolrCloud/Zk

Hi Yury,

How do you manage to start the instances without any issues? The way I see
it, no matter which instance is started first, the slave will complain about
not being to find its respective master because that instance hasn't been
started yet ... no?

Thanks,
- Pulkit

2011/5/17 Yury Kats <yu...@yahoo.com>

> On 5/17/2011 10:17 AM, Stefan Matheis wrote:
> > Yury,
> >
> > perhaps Java-Pararms (like used for this sample:
> >
> http://wiki.apache.org/solr/SolrReplication#enable.2BAC8-disable_master.2BAC8-slave_in_a_node
> )
> > can help you?
>
> Ah, thanks! It does seem to work!
>
> Cluster's solrconfig.xml (shared between all Solr instances and cores via
> SolrCloud/ZK):
> <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>
>  </lst>
>   <lst name="slave">
>    <str name="enable">${enable.slave:false}</str>
>    <str name="pollInterval">00:01:00</str>
>    <str name="masterUrl">http://
> ${masterHost:xyz}/solr/master/replication</str>
>  </lst>
> </requestHandler>
>
> Node 1 solr.xml:
>  <cores adminPath="/admin/cores" defaultCoreName="master">
>    <core name="master" instanceDir="core1" shard="shard1"
> collection="myconf" >
>      <property name="enable.master" value="true" />
>    </core>
>    <core name="slave" instanceDir="core2" shard="shard2"
> collection="myconf">
>      <property name="enable.slave" value="true" />
>      <property name="masterHost" value="node2:8983" />
>    </core>
>  </cores>
>
> Node 2 solr.xml:
>  <cores adminPath="/admin/cores" defaultCoreName="master">
>    <core name="master" instanceDir="core1" shard="shard2"
> collection="myconf" >
>      <property name="enable.master" value="true" />
>    </core>
>    <core name="slave" instanceDir="core2" shard="shard1"
> collection="myconf">
>      <property name="enable.slave" value="true" />
>      <property name="masterHost" value="node1:8983" />
>    </core>
>  </cores>
>
>

Re: Replication setup with SolrCloud/Zk

Posted by Yury Kats <yu...@yahoo.com>.
On 9/10/2011 3:54 PM, Pulkit Singhal wrote:
> Hi Yury,
> 
> How do you manage to start the instances without any issues? The way I see
> it, no matter which instance is started first, the slave will complain about
> not being to find its respective master because that instance hasn't been
> started yet ... no?

Yes, but it's not a big deal. The slaves polls periodically, so next time
around the master will be up.

Re: Replication setup with SolrCloud/Zk

Posted by Pulkit Singhal <pu...@gmail.com>.
Sorry, stupid question, now I see that the core still starts and the polling
process simply logs an error:

SEVERE: Master at: http://localhost:7574/solr/master2/replication is not
available.
Index fetch failed. Exception: Connection refused

I was able to setup the instructions in-detail with this thread's help here:
http://pulkitsinghal.blogspot.com/2011/09/multicore-master-slave-replication-in.html

Thanks,
- Pulkit

On Sat, Sep 10, 2011 at 2:54 PM, Pulkit Singhal <pu...@gmail.com>wrote:

> Hi Yury,
>
> How do you manage to start the instances without any issues? The way I see
> it, no matter which instance is started first, the slave will complain about
> not being to find its respective master because that instance hasn't been
> started yet ... no?
>
> Thanks,
> - Pulkit
>
> 2011/5/17 Yury Kats <yu...@yahoo.com>
>
>> On 5/17/2011 10:17 AM, Stefan Matheis wrote:
>> > Yury,
>> >
>> > perhaps Java-Pararms (like used for this sample:
>> >
>> http://wiki.apache.org/solr/SolrReplication#enable.2BAC8-disable_master.2BAC8-slave_in_a_node
>> )
>> > can help you?
>>
>> Ah, thanks! It does seem to work!
>>
>> Cluster's solrconfig.xml (shared between all Solr instances and cores via
>> SolrCloud/ZK):
>> <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>
>>  </lst>
>>   <lst name="slave">
>>    <str name="enable">${enable.slave:false}</str>
>>    <str name="pollInterval">00:01:00</str>
>>    <str name="masterUrl">http://
>> ${masterHost:xyz}/solr/master/replication</str>
>>  </lst>
>> </requestHandler>
>>
>> Node 1 solr.xml:
>>  <cores adminPath="/admin/cores" defaultCoreName="master">
>>    <core name="master" instanceDir="core1" shard="shard1"
>> collection="myconf" >
>>      <property name="enable.master" value="true" />
>>    </core>
>>    <core name="slave" instanceDir="core2" shard="shard2"
>> collection="myconf">
>>      <property name="enable.slave" value="true" />
>>      <property name="masterHost" value="node2:8983" />
>>    </core>
>>  </cores>
>>
>> Node 2 solr.xml:
>>  <cores adminPath="/admin/cores" defaultCoreName="master">
>>    <core name="master" instanceDir="core1" shard="shard2"
>> collection="myconf" >
>>      <property name="enable.master" value="true" />
>>    </core>
>>    <core name="slave" instanceDir="core2" shard="shard1"
>> collection="myconf">
>>      <property name="enable.slave" value="true" />
>>      <property name="masterHost" value="node1:8983" />
>>    </core>
>>  </cores>
>>
>>
>