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 Wei <we...@gmail.com> on 2018/09/02 23:39:30 UTC

question for rule based replica placement

Hi,

In rule based replica placement,  how to ensure there are no more than one
replica for any shard on the same host?   In the documentation there is an
example rule

        shard:*,replica:<2,node:*

Does 'node' refer to solr instance or actual physical host?  Is there an
example for defining the physical host?

Thanks,
Wei

Re: question for rule based replica placement

Posted by Wei <we...@gmail.com>.
Thanks Erick. Suppose I have 5 hosts h1,h2,h3,h4,h5  and want to create a
5X2 solr cloud of 5 shards, 2 replicas per shard. On each host I will run
two solr JVMs, each hosts a single solr core. Solr's default 'snitch'
provide a 'host' tag, so I wonder if I can use it to prevent any host from
have two replicas from the same shard, when creating collection:

/solr/admin/collections?action=CREATE&name=mycollection&numShards=5&replicationFactor=2&maxShardsPerNode=1&rule=shard:*,
replica<2, host:*

Is this the correct way to use 'snitch'? I cannot find more relevant
documentation on how to configure and customize 'snitch'.

Thanks,
Wei

On Sun, Sep 2, 2018 at 9:30 PM Erick Erickson <er...@gmail.com>
wrote:

> You need to provide a "snitch" and define a rule appropriately. This
> is a variant of "rack awareness".
>
> Solr considers two JVMs running on the same physical host as
> completely separate Solr instances, so to get replicas on different
> hosts you need a snitch etc.
>
> Best,
> Erick
> On Sun, Sep 2, 2018 at 4:39 PM Wei <we...@gmail.com> wrote:
> >
> > Hi,
> >
> > In rule based replica placement,  how to ensure there are no more than
> one
> > replica for any shard on the same host?   In the documentation there is
> an
> > example rule
> >
> >         shard:*,replica:<2,node:*
> >
> > Does 'node' refer to solr instance or actual physical host?  Is there an
> > example for defining the physical host?
> >
> > Thanks,
> > Wei
>

Re: question for rule based replica placement

Posted by Erick Erickson <er...@gmail.com>.
You need to provide a "snitch" and define a rule appropriately. This
is a variant of "rack awareness".

Solr considers two JVMs running on the same physical host as
completely separate Solr instances, so to get replicas on different
hosts you need a snitch etc.

Best,
Erick
On Sun, Sep 2, 2018 at 4:39 PM Wei <we...@gmail.com> wrote:
>
> Hi,
>
> In rule based replica placement,  how to ensure there are no more than one
> replica for any shard on the same host?   In the documentation there is an
> example rule
>
>         shard:*,replica:<2,node:*
>
> Does 'node' refer to solr instance or actual physical host?  Is there an
> example for defining the physical host?
>
> Thanks,
> Wei