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 Arnold Bronley <ar...@gmail.com> on 2019/08/13 17:57:36 UTC

Turn off CDCR for only selected target clusters

Hi,

Is there a way to turn off the CDCR for only selected target clusters.

Say, I have a configuration like following. I have 3 target clusters
targetZkHost1, targetZkHost2 and targetZkHost3. Is it possible to turn off
the CDCR for targetZkHost2 and targetZkHost3 but keep it on for
targetZkHost1?

E.g.

  <requestHandler name="/cdcr" class="solr.CdcrRequestHandler">
 <lst name="replica">
<str name="zkHost">${targetZkHost1}</str>
<str name="source">${collection.configName}</str>
<str name="target">${collection.configName}</str>
 </lst>

 <lst name="replica">
<str name="zkHost">${targetZkHost2}</str>
<str name="source">${collection.configName}</str>
<str name="target">${collection.configName}</str>
 </lst>

 <lst name="replica">
<str name="zkHost">${targetZkHost3}</str>
<str name="source">${collection.configName}</str>
<str name="target">${collection.configName}</str>
 </lst>

 <lst name="replicator">
<str name="threadPoolSize">8</str>
<str name="schedule">1000</str>
<str name="batchSize">128</str>
 </lst>

 <lst name="updateLogSynchronizer">
<str name="schedule">1000</str>
 </lst>

 <lst name="buffer">
<str name="defaultState">disabled</str>
 </lst>
  </requestHandler>

Re: Turn off CDCR for only selected target clusters

Posted by Arnold Bronley <ar...@gmail.com>.
@Shawn: You are right. In my case, the collection name is same as
configuration name and that is why it works. Do you know if there is some
other property that I can use that refers to the collection name instead?

On Wed, Aug 28, 2019 at 3:52 PM Shawn Heisey <ap...@elyograg.org> wrote:

> On 8/28/2019 1:42 PM, Arnold Bronley wrote:
> > I have configured the SolrCloud collection-wise only and there is no
> other
> > way. The way you have defined 3 zkHosts (comma separated values for
> zkHost
> > property), I tried that one before as it was more intuitive. But it did
> not
> > work for me. I had to use 3 different replica elements each for one of
> the
> > 3 SolrCloud clusters. source and target properties mention the same
> > collection name in my case. Instead of hardcoding it, I am using the
> > collection.configName variable which gets replaced by the collection name
> > to which this solrconfig.xml belongs to.
>
> I am pretty sure that ${collection.configName} refers to the
> configuration name stored in zookeeper, NOT the collection name.  There
> is nothing at all in Solr that requires those names to be the same, and
> for many SolrCloud installs, they are not the same.  If this is working
> for you, then you're probably naming your configs the same as the
> collection.  If you were to ever use the same config on multiple
> collections, that would probably stop working.
>
> I do not know if there is a property with the collection name.  There
> probably is.
>
> Thanks,
> Shawn
>

Re: Turn off CDCR for only selected target clusters

Posted by Shawn Heisey <ap...@elyograg.org>.
On 8/28/2019 1:42 PM, Arnold Bronley wrote:
> I have configured the SolrCloud collection-wise only and there is no other
> way. The way you have defined 3 zkHosts (comma separated values for zkHost
> property), I tried that one before as it was more intuitive. But it did not
> work for me. I had to use 3 different replica elements each for one of the
> 3 SolrCloud clusters. source and target properties mention the same
> collection name in my case. Instead of hardcoding it, I am using the
> collection.configName variable which gets replaced by the collection name
> to which this solrconfig.xml belongs to.

I am pretty sure that ${collection.configName} refers to the 
configuration name stored in zookeeper, NOT the collection name.  There 
is nothing at all in Solr that requires those names to be the same, and 
for many SolrCloud installs, they are not the same.  If this is working 
for you, then you're probably naming your configs the same as the 
collection.  If you were to ever use the same config on multiple 
collections, that would probably stop working.

I do not know if there is a property with the collection name.  There 
probably is.

Thanks,
Shawn

Re: Turn off CDCR for only selected target clusters

Posted by Arnold Bronley <ar...@gmail.com>.
Hi Erick,

I have configured the SolrCloud collection-wise only and there is no other
way. The way you have defined 3 zkHosts (comma separated values for zkHost
property), I tried that one before as it was more intuitive. But it did not
work for me. I had to use 3 different replica elements each for one of the
3 SolrCloud clusters. source and target properties mention the same
collection name in my case. Instead of hardcoding it, I am using the
collection.configName variable which gets replaced by the collection name
to which this solrconfig.xml belongs to.

If follow your configuration (which does not work in my case and I have
tested it), my question was how to NOT send CDCR updates to targetZkHost2
and targetZkHost3 but not targetZkHost1?

On Tue, Aug 13, 2019 at 3:23 PM Erick Erickson <er...@gmail.com>
wrote:

> You configure CDCR by _collection_, so this question really makes no
> sense.
> You’d never mention collection.configName. So what I suspect is that you’re
> misreading the docs.
>
> <lst name="replica">
> <str name="zkHost">${targetZkHost1},${targetZkHost2},${targetZkHost3}</str>
> <str name="source">sourceCollection_on_local_cluster</str>
> <str name="target">targetCollection_on_targetZkHost1 2 and 3</str>
> </lst>
>
> “Turning off CDCR” selective for ZooKeeper instances really makes no sense
> as the
> point of ZK ensembles is to keep running even if one goes away.
>
> So can you rephrase the question? Or state the problem you’re trying to
> solve another way?
>
> Best,
> Erick
>
> > On Aug 13, 2019, at 1:57 PM, Arnold Bronley <ar...@gmail.com>
> wrote:
> >
> > Hi,
> >
> > Is there a way to turn off the CDCR for only selected target clusters.
> >
> > Say, I have a configuration like following. I have 3 target clusters
> > targetZkHost1, targetZkHost2 and targetZkHost3. Is it possible to turn
> off
> > the CDCR for targetZkHost2 and targetZkHost3 but keep it on for
> > targetZkHost1?
> >
> > E.g.
> >
> >  <requestHandler name="/cdcr" class="solr.CdcrRequestHandler">
> > <lst name="replica">
> > <str name="zkHost">${targetZkHost1}</str>
> > <str name="source">${collection.configName}</str>
> > <str name="target">${collection.configName}</str>
> > </lst>
> >
> > <lst name="replica">
> > <str name="zkHost">${targetZkHost2}</str>
> > <str name="source">${collection.configName}</str>
> > <str name="target">${collection.configName}</str>
> > </lst>
> >
> > <lst name="replica">
> > <str name="zkHost">${targetZkHost3}</str>
> > <str name="source">${collection.configName}</str>
> > <str name="target">${collection.configName}</str>
> > </lst>
> >
> > <lst name="replicator">
> > <str name="threadPoolSize">8</str>
> > <str name="schedule">1000</str>
> > <str name="batchSize">128</str>
> > </lst>
> >
> > <lst name="updateLogSynchronizer">
> > <str name="schedule">1000</str>
> > </lst>
> >
> > <lst name="buffer">
> > <str name="defaultState">disabled</str>
> > </lst>
> >  </requestHandler>
>
>

Re: Turn off CDCR for only selected target clusters

Posted by Erick Erickson <er...@gmail.com>.
You configure CDCR by _collection_, so this question really makes no sense. 
You’d never mention collection.configName. So what I suspect is that you’re
misreading the docs. 

<lst name="replica">
<str name="zkHost">${targetZkHost1},${targetZkHost2},${targetZkHost3}</str>
<str name="source">sourceCollection_on_local_cluster</str>
<str name="target">targetCollection_on_targetZkHost1 2 and 3</str>
</lst>

“Turning off CDCR” selective for ZooKeeper instances really makes no sense as the
point of ZK ensembles is to keep running even if one goes away.

So can you rephrase the question? Or state the problem you’re trying to solve another way?

Best,
Erick

> On Aug 13, 2019, at 1:57 PM, Arnold Bronley <ar...@gmail.com> wrote:
> 
> Hi,
> 
> Is there a way to turn off the CDCR for only selected target clusters.
> 
> Say, I have a configuration like following. I have 3 target clusters
> targetZkHost1, targetZkHost2 and targetZkHost3. Is it possible to turn off
> the CDCR for targetZkHost2 and targetZkHost3 but keep it on for
> targetZkHost1?
> 
> E.g.
> 
>  <requestHandler name="/cdcr" class="solr.CdcrRequestHandler">
> <lst name="replica">
> <str name="zkHost">${targetZkHost1}</str>
> <str name="source">${collection.configName}</str>
> <str name="target">${collection.configName}</str>
> </lst>
> 
> <lst name="replica">
> <str name="zkHost">${targetZkHost2}</str>
> <str name="source">${collection.configName}</str>
> <str name="target">${collection.configName}</str>
> </lst>
> 
> <lst name="replica">
> <str name="zkHost">${targetZkHost3}</str>
> <str name="source">${collection.configName}</str>
> <str name="target">${collection.configName}</str>
> </lst>
> 
> <lst name="replicator">
> <str name="threadPoolSize">8</str>
> <str name="schedule">1000</str>
> <str name="batchSize">128</str>
> </lst>
> 
> <lst name="updateLogSynchronizer">
> <str name="schedule">1000</str>
> </lst>
> 
> <lst name="buffer">
> <str name="defaultState">disabled</str>
> </lst>
>  </requestHandler>