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 Daniel Carrasco <d....@i2tic.com> on 2018/02/01 12:34:35 UTC

Request node status independently

Hello,

I'm trying to create a load balancer using HAProxy to detect nodes that are
down or recovering, but I'm not able to find the way to detect if the node
is healthy (the only commands i've seen check the entire cluster).
Is there any way to check the node status using http responses and get only
if is healthy or recovering?. Of course if is dead I've got no response, so
that's easy.

Thanks and greetings!!

-- 
_________________________________________

      Daniel Carrasco Marín
      Ingeniería para la Innovación i2TIC, S.L.
      Tlf:  +34 911 12 32 84 Ext: 223
      www.i2tic.com
_________________________________________

Re: Request node status independently

Posted by Erick Erickson <er...@gmail.com>.
There's no wildcard for the CLUSTERSTATUS command. You can request
status for specific _collections_ by using the "collection" parameter
though.

Best,
Erick

On Thu, Feb 1, 2018 at 10:15 AM, Atita Arora <at...@gmail.com> wrote:
> Hi Erick,
>
> Just as you mentioned about clusterstatus, I am using the same for almost
> the similar Usecase. The only issue I run into is that I need some way I
> could use prefix with collection param, is there some way to do that? So
> that I  can  query the specific collection of my interest.
> Note : My collection names are prefixed with clientId.
>
> Thanks,
> Atita
>
> On Feb 1, 2018 10:06 PM, "Erick Erickson" <er...@gmail.com> wrote:
>
>> The Collections API CLUSTERSTATUS essentially gives you back the ZK
>> state.json for individual collections (or your cluster, see the
>> params). One note: Just because the state.json reports a replica as
>> "active" isn't definitive. If the node died unexpectedly its replicas
>> can't set the state when shutting down. So you also have to check
>> whether the replica's node is in the "live_nodes" znode.
>>
>> Best,
>> Erick
>>
>> On Thu, Feb 1, 2018 at 4:34 AM, Daniel Carrasco <d....@i2tic.com>
>> wrote:
>> > Hello,
>> >
>> > I'm trying to create a load balancer using HAProxy to detect nodes that
>> are
>> > down or recovering, but I'm not able to find the way to detect if the
>> node
>> > is healthy (the only commands i've seen check the entire cluster).
>> > Is there any way to check the node status using http responses and get
>> only
>> > if is healthy or recovering?. Of course if is dead I've got no response,
>> so
>> > that's easy.
>> >
>> > Thanks and greetings!!
>> >
>> > --
>> > _________________________________________
>> >
>> >       Daniel Carrasco Marín
>> >       Ingeniería para la Innovación i2TIC, S.L.
>> >       Tlf:  +34 911 12 32 84 Ext: 223
>> >       www.i2tic.com
>> > _________________________________________
>>

Re: Request node status independently

Posted by Atita Arora <at...@gmail.com>.
Hi Erick,

Just as you mentioned about clusterstatus, I am using the same for almost
the similar Usecase. The only issue I run into is that I need some way I
could use prefix with collection param, is there some way to do that? So
that I  can  query the specific collection of my interest.
Note : My collection names are prefixed with clientId.

Thanks,
Atita

On Feb 1, 2018 10:06 PM, "Erick Erickson" <er...@gmail.com> wrote:

> The Collections API CLUSTERSTATUS essentially gives you back the ZK
> state.json for individual collections (or your cluster, see the
> params). One note: Just because the state.json reports a replica as
> "active" isn't definitive. If the node died unexpectedly its replicas
> can't set the state when shutting down. So you also have to check
> whether the replica's node is in the "live_nodes" znode.
>
> Best,
> Erick
>
> On Thu, Feb 1, 2018 at 4:34 AM, Daniel Carrasco <d....@i2tic.com>
> wrote:
> > Hello,
> >
> > I'm trying to create a load balancer using HAProxy to detect nodes that
> are
> > down or recovering, but I'm not able to find the way to detect if the
> node
> > is healthy (the only commands i've seen check the entire cluster).
> > Is there any way to check the node status using http responses and get
> only
> > if is healthy or recovering?. Of course if is dead I've got no response,
> so
> > that's easy.
> >
> > Thanks and greetings!!
> >
> > --
> > _________________________________________
> >
> >       Daniel Carrasco Marín
> >       Ingeniería para la Innovación i2TIC, S.L.
> >       Tlf:  +34 911 12 32 84 Ext: 223
> >       www.i2tic.com
> > _________________________________________
>

Re: Request node status independently

Posted by Daniel Carrasco <d....@i2tic.com>.
Thanks to both.

Finally I've found a way to do it with haproxy. I do what wunder said
sending the command for every collection and see if it's able to answer.
Even in recovering answer, so looks like it takes the data from other nodes
of use the data that have.

Greetings!!


El 1 feb. 2018 17:57, "Walter Underwood" <wu...@wunderwood.org> escribió:

Also, “recovering” is a status for a particular core in a collection. A
Solr process might have some cores that are healthy and some that are not.

Even if you only have one collection, you can still have multiple cores
(with different status) from the same collection on one node.

Personally, I do a search to see if a collection is ready. If a search for
“q=*:*&rows=0” returns OK, then I’ll send traffic to that node.

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)

> On Feb 1, 2018, at 8:35 AM, Erick Erickson <er...@gmail.com>
wrote:
>
> The Collections API CLUSTERSTATUS essentially gives you back the ZK
> state.json for individual collections (or your cluster, see the
> params). One note: Just because the state.json reports a replica as
> "active" isn't definitive. If the node died unexpectedly its replicas
> can't set the state when shutting down. So you also have to check
> whether the replica's node is in the "live_nodes" znode.
>
> Best,
> Erick
>
> On Thu, Feb 1, 2018 at 4:34 AM, Daniel Carrasco <d....@i2tic.com>
wrote:
>> Hello,
>>
>> I'm trying to create a load balancer using HAProxy to detect nodes that
are
>> down or recovering, but I'm not able to find the way to detect if the
node
>> is healthy (the only commands i've seen check the entire cluster).
>> Is there any way to check the node status using http responses and get
only
>> if is healthy or recovering?. Of course if is dead I've got no response,
so
>> that's easy.
>>
>> Thanks and greetings!!
>>
>> --
>> _________________________________________
>>
>>      Daniel Carrasco Marín
>>      Ingeniería para la Innovación i2TIC, S.L.
>>      Tlf:  +34 911 12 32 84 Ext: 223
>>      www.i2tic.com
>> _________________________________________

Re: Request node status independently

Posted by Walter Underwood <wu...@wunderwood.org>.
Also, “recovering” is a status for a particular core in a collection. A Solr process might have some cores that are healthy and some that are not.

Even if you only have one collection, you can still have multiple cores (with different status) from the same collection on one node.

Personally, I do a search to see if a collection is ready. If a search for “q=*:*&rows=0” returns OK, then I’ll send traffic to that node.

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)

> On Feb 1, 2018, at 8:35 AM, Erick Erickson <er...@gmail.com> wrote:
> 
> The Collections API CLUSTERSTATUS essentially gives you back the ZK
> state.json for individual collections (or your cluster, see the
> params). One note: Just because the state.json reports a replica as
> "active" isn't definitive. If the node died unexpectedly its replicas
> can't set the state when shutting down. So you also have to check
> whether the replica's node is in the "live_nodes" znode.
> 
> Best,
> Erick
> 
> On Thu, Feb 1, 2018 at 4:34 AM, Daniel Carrasco <d....@i2tic.com> wrote:
>> Hello,
>> 
>> I'm trying to create a load balancer using HAProxy to detect nodes that are
>> down or recovering, but I'm not able to find the way to detect if the node
>> is healthy (the only commands i've seen check the entire cluster).
>> Is there any way to check the node status using http responses and get only
>> if is healthy or recovering?. Of course if is dead I've got no response, so
>> that's easy.
>> 
>> Thanks and greetings!!
>> 
>> --
>> _________________________________________
>> 
>>      Daniel Carrasco Marín
>>      Ingeniería para la Innovación i2TIC, S.L.
>>      Tlf:  +34 911 12 32 84 Ext: 223
>>      www.i2tic.com
>> _________________________________________


Re: Request node status independently

Posted by Erick Erickson <er...@gmail.com>.
The Collections API CLUSTERSTATUS essentially gives you back the ZK
state.json for individual collections (or your cluster, see the
params). One note: Just because the state.json reports a replica as
"active" isn't definitive. If the node died unexpectedly its replicas
can't set the state when shutting down. So you also have to check
whether the replica's node is in the "live_nodes" znode.

Best,
Erick

On Thu, Feb 1, 2018 at 4:34 AM, Daniel Carrasco <d....@i2tic.com> wrote:
> Hello,
>
> I'm trying to create a load balancer using HAProxy to detect nodes that are
> down or recovering, but I'm not able to find the way to detect if the node
> is healthy (the only commands i've seen check the entire cluster).
> Is there any way to check the node status using http responses and get only
> if is healthy or recovering?. Of course if is dead I've got no response, so
> that's easy.
>
> Thanks and greetings!!
>
> --
> _________________________________________
>
>       Daniel Carrasco Marín
>       Ingeniería para la Innovación i2TIC, S.L.
>       Tlf:  +34 911 12 32 84 Ext: 223
>       www.i2tic.com
> _________________________________________