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 jimtronic <ji...@gmail.com> on 2016/09/22 17:33:27 UTC

Solr Cloud prevent Ping Request From Forwarding Request

Here's the scenario:

Boxes 1,2, and 3 have replicas of collections dogs and cats. Box 4 has only
a replica of dogs.

All of these boxes have a healthcheck file on them that works with the
PingRequestHandler to say whether the box is up or not.

If I hit Box4/cats/admin/ping, Solr forwards the ping request to another box
which returns with status OK.

Is there anyway to stop a box from forwarding a request to another node?

Thanks!



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-Cloud-prevent-Ping-Request-From-Forwarding-Request-tp4297521.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr Cloud prevent Ping Request From Forwarding Request

Posted by Shawn Heisey <ap...@elyograg.org>.
On 9/22/2016 11:33 AM, jimtronic wrote:
> Boxes 1,2, and 3 have replicas of collections dogs and cats. Box 4 has
> only a replica of dogs. All of these boxes have a healthcheck file on
> them that works with the PingRequestHandler to say whether the box is
> up or not. If I hit Box4/cats/admin/ping, Solr forwards the ping
> request to another box which returns with status OK. Is there anyway
> to stop a box from forwarding a request to another node?

SolrCloud assures that as long as a node is functional, and the
collection is whole *somewhere* in the cloud, requests will work, even
if the node you're talking to has absolutely no data from that collection.

What exactly are you trying to determine with your ping handler?

If you're trying to check the status of the cores on each specific
machine, that's not the way to do it.  Try  sending a request directly
to the core (cats_shard1_replica1, for example) with distrib=false. 
That should remain entirely local.  The core name will typically be
different for every server that contains replicas for that collection,
which can make automation difficult.  You can get a list of cores for a
machine with a call to the CoreAdmin API.

To check whether the MACHINE is working, independent from any core or
collection, use a request for something global, like the LIST command on
the Collections API.

A request to /solr/<collection>/admin/ping is a check to make sure the
*collection* is working.  It's reasonable in that scenario for SolrCloud
to forward the request to wherever it needs to go, and to load balance
the requests across the cloud -- that's what it is designed to do.  If
the request works, then the machine must be working ...but you can also
be sure that the collection is working, wherever it might live.

If you use "distrib=false" with a URL containing the *collection* name
(instead of the specific core name), the distrib parameter is probably
ignored, because satisfying a request sent to the collection name
requires a distributed lookup in zookeeper data just to learn where the
collection lives.  I do not have a large enough cloud install to check
whether this is true.

Thanks,
Shawn


Re: Solr Cloud prevent Ping Request From Forwarding Request

Posted by jimtronic <ji...@gmail.com>.
It seems like all the parameters in the PingHandler get processed by the
remote server. So, things like shards=localhost or distrib=false take effect
too late.






--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-Cloud-prevent-Ping-Request-From-Forwarding-Request-tp4297521p4297565.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr Cloud prevent Ping Request From Forwarding Request

Posted by Erick Erickson <er...@gmail.com>.
Don't know if it works with ping, but try &distrib=false perhaps?

But wouldn't you still have, at best, "no such collection?" or
something?

You may have to read state(s) from Zookeeper and ping each one
directly only if it has a replica for a particular collection.

Best,
Erick

On Thu, Sep 22, 2016 at 10:33 AM, jimtronic <ji...@gmail.com> wrote:
> Here's the scenario:
>
> Boxes 1,2, and 3 have replicas of collections dogs and cats. Box 4 has only
> a replica of dogs.
>
> All of these boxes have a healthcheck file on them that works with the
> PingRequestHandler to say whether the box is up or not.
>
> If I hit Box4/cats/admin/ping, Solr forwards the ping request to another box
> which returns with status OK.
>
> Is there anyway to stop a box from forwarding a request to another node?
>
> Thanks!
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-Cloud-prevent-Ping-Request-From-Forwarding-Request-tp4297521.html
> Sent from the Solr - User mailing list archive at Nabble.com.