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 Zheng Lin Edwin Yeo <ed...@gmail.com> on 2018/06/06 03:43:56 UTC

Solr 'healthcheck' command

Hi,

I understand that we can do the health checking of the Solr by using the
solr.cmd command under ./bin/solr, which is run from command prompt.

Would like to check, is this feature available via URL from browser?

I am using Solr 7.3.1.

Regards,
Edwin

Re: Solr 'healthcheck' command

Posted by Zheng Lin Edwin Yeo <ed...@gmail.com>.
Thanks for the info.

Previously you have mentioned that there's no URL for CloudSolrClient, so
this will be the same scenario?

Regards,
Edwin

On 6 June 2018 at 13:37, Shawn Heisey <ap...@elyograg.org> wrote:

> On 6/5/2018 11:22 PM, Zheng Lin Edwin Yeo wrote:
>
>> For this clusterstatus, as we are still pointing it at the Solr directly
>> http://localhost:8983/solr/admin/collections?action=CLUSTERSTATUS
>>
>> It is not likely to work if the main replica is down.
>>
>> Let's say I have 2 replica, one in localhost:8983, and other in another
>> server, like 192.168.1.2:8984. If the localhost:8983 is down, the query
>> will not work, and it will not know if the other replica is still running
>> or not, unless we change the URL to
>> http://192.168.1.2:8984/solr/admin/collections?action=CLUSTERSTATUS
>>
>> I'm looking to able to do this automatically without changing the IP
>> address and URL. The solr.cmd command can do it, but we are finding out if
>> this can be done via URL?
>>
>
> The healthcheck is able to do this even when servers go down because it
> uses CloudSolrClient.  This client connects to zookeeper, where it can
> learn everything about the cloud, including which servers are working.
>
> To achieve what you want at the HTTP level, so you could type the URL in a
> browser or use something that's not cloud-aware, you need to access it
> through a load balancer sitting in front of Solr.  With a good config, a
> load balancer would be able to deal with servers going down.  Either that
> or you would need to use software that you can configure with at least two
> URLs, that is able to try another URL if one doesn't work.
>
> Thanks,
> Shawn
>
>

Re: Solr 'healthcheck' command

Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/5/2018 11:22 PM, Zheng Lin Edwin Yeo wrote:
> For this clusterstatus, as we are still pointing it at the Solr directly
> http://localhost:8983/solr/admin/collections?action=CLUSTERSTATUS
>
> It is not likely to work if the main replica is down.
>
> Let's say I have 2 replica, one in localhost:8983, and other in another
> server, like 192.168.1.2:8984. If the localhost:8983 is down, the query
> will not work, and it will not know if the other replica is still running
> or not, unless we change the URL to
> http://192.168.1.2:8984/solr/admin/collections?action=CLUSTERSTATUS
>
> I'm looking to able to do this automatically without changing the IP
> address and URL. The solr.cmd command can do it, but we are finding out if
> this can be done via URL?

The healthcheck is able to do this even when servers go down because it 
uses CloudSolrClient.  This client connects to zookeeper, where it can 
learn everything about the cloud, including which servers are working.

To achieve what you want at the HTTP level, so you could type the URL in 
a browser or use something that's not cloud-aware, you need to access it 
through a load balancer sitting in front of Solr.  With a good config, a 
load balancer would be able to deal with servers going down.  Either 
that or you would need to use software that you can configure with at 
least two URLs, that is able to try another URL if one doesn't work.

Thanks,
Shawn


Re: Solr 'healthcheck' command

Posted by Zheng Lin Edwin Yeo <ed...@gmail.com>.
For this clusterstatus, as we are still pointing it at the Solr directly
http://localhost:8983/solr/admin/collections?action=CLUSTERSTATUS

It is not likely to work if the main replica is down.

Let's say I have 2 replica, one in localhost:8983, and other in another
server, like 192.168.1.2:8984. If the localhost:8983 is down, the query
will not work, and it will not know if the other replica is still running
or not, unless we change the URL to
http://192.168.1.2:8984/solr/admin/collections?action=CLUSTERSTATUS

I'm looking to able to do this automatically without changing the IP
address and URL. The solr.cmd command can do it, but we are finding out if
this can be done via URL?

Regards,
Edwin


On 6 June 2018 at 13:03, Shawn Heisey <ap...@elyograg.org> wrote:

> On 6/5/2018 10:58 PM, Zheng Lin Edwin Yeo wrote:
>
>> The healthcheck action in SolrCLI is able to return the health status of
>> individual collection, while this http://host:port/solr/admin/info/system
>> URL
>> returns the overall health status of Solr.
>> We will need the information on the health status of individual
>> collection,
>> like the status of the replica, and which replica are the leader. Any idea
>> if this is possible to do from URL?
>>
>
> This might be what you're after:
>
> https://lucene.apache.org/solr/guide/7_3/collections-api.
> html#clusterstatus
>
> Thanks,
> Shawn
>
>

Re: Solr 'healthcheck' command

Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/5/2018 10:58 PM, Zheng Lin Edwin Yeo wrote:
> The healthcheck action in SolrCLI is able to return the health status of
> individual collection, while this http://host:port/solr/admin/info/system URL
> returns the overall health status of Solr.
> We will need the information on the health status of individual collection,
> like the status of the replica, and which replica are the leader. Any idea
> if this is possible to do from URL?

This might be what you're after:

https://lucene.apache.org/solr/guide/7_3/collections-api.html#clusterstatus

Thanks,
Shawn


Re: Solr 'healthcheck' command

Posted by Zheng Lin Edwin Yeo <ed...@gmail.com>.
Hi Shawn,

Thanks for the reply.

The healthcheck action in SolrCLI is able to return the health status of
individual collection, while this http://host:port/solr/admin/info/system URL
returns the overall health status of Solr.
We will need the information on the health status of individual collection,
like the status of the replica, and which replica are the leader. Any idea
if this is possible to do from URL?

Regards,
Edwin

On 6 June 2018 at 12:09, Shawn Heisey <ap...@elyograg.org> wrote:

> On 6/5/2018 9:43 PM, Zheng Lin Edwin Yeo wrote:
>
>> I understand that we can do the health checking of the Solr by using the
>> solr.cmd command under ./bin/solr, which is run from command prompt.
>>
>> Would like to check, is this feature available via URL from browser?
>>
>> I am using Solr 7.3.1.
>>
>
> The healthcheck action in SolrCLI, which looks like it only works with
> SolrCloud, appears to take these actions:
>
> 1) Finds the first shard leader for the named collection, does an http
> HEAD request to make sure it's responding.
> 2) Does a *:* query on the named collection to make sure there is a good
> response.
> 3) Then it sends this URL to a host with a leader replica and gathers some
> info about the system.
>
> http://host:port/solr/admin/info/system
>
> Doing the *:* query on the collection would give you the important part of
> the healthcheck.  If the response has a 200 code, chances are excellent
> that it's working.
>
> Thanks,
> Shawn
>
>

Re: Solr 'healthcheck' command

Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/5/2018 9:43 PM, Zheng Lin Edwin Yeo wrote:
> I understand that we can do the health checking of the Solr by using the
> solr.cmd command under ./bin/solr, which is run from command prompt.
>
> Would like to check, is this feature available via URL from browser?
>
> I am using Solr 7.3.1.

The healthcheck action in SolrCLI, which looks like it only works with 
SolrCloud, appears to take these actions:

1) Finds the first shard leader for the named collection, does an http 
HEAD request to make sure it's responding.
2) Does a *:* query on the named collection to make sure there is a good 
response.
3) Then it sends this URL to a host with a leader replica and gathers 
some info about the system.

http://host:port/solr/admin/info/system

Doing the *:* query on the collection would give you the important part 
of the healthcheck.  If the response has a 200 code, chances are 
excellent that it's working.

Thanks,
Shawn