You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Matthew Castrigno <ca...@slhs.org> on 2023/01/19 19:32:07 UTC

What does "OK" mean in the status of the response of the ping handler?

Can I assume my index/core is not corrupt to the extent that SOLR can detect such condition?
Is this the best heath indicator?

https://solr.apache.org/guide/solr/latest/deployment-guide/ping.html#ping-api-examples


Thank you for your insights.




[cid:09f1b9bf-8835-4bba-91ed-60214c3f2c05]

Matthew Castrigno

IHT Developer II

St. Luke’s Health System

•  208-859-4276
•  castrigm@slhs.org<ma...@slhs.org>

----------------------------------------------------------------------
"This message is intended for the use of the person or entity to which it is addressed and may contain information that is confidential or privileged, the disclosure of which is governed by applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this information is strictly prohibited. If you have received this message by error, please notify us immediately and destroy the related message."

Re: What does "OK" mean in the status of the response of the ping handler?

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/20/23 12:14, Matthew Castrigno wrote:
> 
> Thank you Shawn.
> 
> My configuration is standalone mode.
> 
> We are going to use HAproxy  and need a metric to determine when to 
> switch between two servers. The severs are kept "in sync" with each 
> other by copying the cores from one to another. This works for our use 
> case which only indexes new content on a schedule which we control.

I believe it also returns an HTTP response code that's an error type if 
the query fails.  Because your ping handler has a q parameter, I think 
you can reasonably rely on the OK status as a good check, and I *THINK* 
you can also rely on the http response code.

I like to use the healthcheck option, and I do know that it returns a 
503 response code if the healthcheck flag is not enabled.  This is a 
really good way to make it so that healthy servers are removed from 
rotation in case you want to force queries to go elsewhere.

Thanks,
Shawn

Re: What does "OK" mean in the status of the response of the ping handler?

Posted by Matthew Castrigno <ca...@slhs.org>.
Thank you Shawn.

My configuration is standalone mode.

We are going to use HAproxy  and need a metric to determine when to switch between two servers. The severs are kept "in sync" with each other by copying the cores from one to another. This works for our use case which only indexes new content on a schedule which we control.

Since sending this message I read that I can set up my own ping handler. There appears to be none in the default configuration, but the core does respond to the ping endpoint (/admin/ping) so there must be some implict request handler configuration for that endpoint.

So, I guess my first question was is that response to /admin/ping  telling me? (what exactly does "status":"OK" mean)
    "responseHeader": {
        "zkConnected": null,
        "status": 0,
        "QTime": 0,
        "params": {
            "q": "{!lucene}*:*",
            "distrib": "false",
            "df": "_text_",
            "rows": "10",
            "echoParams": "all",
            "indent": "true",
            "rid": "-6"
        }
    },
    "status": "OK"
}

If I setup my own ping handler and configure it to do a query. Does this indicate any greater health that just sending a query and getting back a 200 response?

I am considering this example from the web:

<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
        <lst name="invariants">
                <!-- specify the handler to delegate to -->
                <str name="qt">/search</str>
        <str name="q">some test query</str>
        </lst>
        <lst name="defaults">
                <str name="echoParams">all</str>
                <str name="df">article</str>
        </lst>
        <!-- relative paths are resolved against the data dir -->
        <str name="healthcheckFile">server-enabled.txt</str>
</requestHandler>


What do you recommend for ping handler request?

Also, I am wondering about the healthcheckFile, I can't find any information about what I can put in there other than enabling/disabling the ping endpoint. Where is there more information on this fiile? Search the doc for healthcheckFile returns No results found for query "healthcheckFile"

Thank you for your insights.



[cid:1b41aba7-9b3b-4ff1-88f0-9f1d6aaad553]

Matthew Castrigno

IHT Developer II

St. Luke’s Health System

•  208-859-4276
•  castrigm@slhs.org<ma...@slhs.org>

________________________________
From: Shawn Heisey <ap...@elyograg.org>
Sent: Thursday, January 19, 2023 7:26 PM
To: users@solr.apache.org <us...@solr.apache.org>
Subject: Re: What does "OK" mean in the status of the response of the ping handler?

On 1/19/23 12: 32, Matthew Castrigno wrote: > Can I assume my index/core is not corrupt to the extent that SOLR can > detect such condition? > Is this the best heath indicator? > > https: //urldefense. com/v3/__https: //solr. apache. org/guide/solr/latest/deployment-guide/ping. html*ping-api-examples__;Iw!!FkC3_z_N!LmxefpYhLsy8Qy0bSEuC8-rndzi-PlTTbrLNROpVKY9K7DegR0ziz9BbaTFRHldvw3NGj8ZEPUNOkeg$
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside the St. Luke's email system.

ZjQcmQRYFpfptBannerEnd

On 1/19/23 12:32, Matthew Castrigno wrote:
> Can I assume my index/core is not corrupt to the extent that SOLR can
> detect such condition?
> Is this the best heath indicator?
>
> https://urldefense.com/v3/__https://solr.apache.org/guide/solr/latest/deployment-guide/ping.html*ping-api-examples__;Iw!!FkC3_z_N!LmxefpYhLsy8Qy0bSEuC8-rndzi-PlTTbrLNROpVKY9K7DegR0ziz9BbaTFRHldvw3NGj8ZEPUNOkeg$ <https://urldefense.com/v3/__https://solr.apache.org/guide/solr/latest/deployment-guide/ping.html*ping-api-examples__;Iw!!FkC3_z_N!LmxefpYhLsy8Qy0bSEuC8-rndzi-PlTTbrLNROpVKY9K7DegR0ziz9BbaTFRHldvw3NGj8ZEPUNOkeg$>

How do you have your ping handler configured in solrconfig.xml?  What is
the exacy request you are sending to it?

Is Solr in cloud mode or standalone?

Thanks,
Shawn


----------------------------------------------------------------------
"This message is intended for the use of the person or entity to which it is addressed and may contain information that is confidential or privileged, the disclosure of which is governed by applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this information is strictly prohibited. If you have received this message by error, please notify us immediately and destroy the related message."

Re: What does "OK" mean in the status of the response of the ping handler?

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/19/23 12:32, Matthew Castrigno wrote:
> Can I assume my index/core is not corrupt to the extent that SOLR can 
> detect such condition?
> Is this the best heath indicator?
> 
> https://solr.apache.org/guide/solr/latest/deployment-guide/ping.html#ping-api-examples <https://solr.apache.org/guide/solr/latest/deployment-guide/ping.html#ping-api-examples>

How do you have your ping handler configured in solrconfig.xml?  What is 
the exacy request you are sending to it?

Is Solr in cloud mode or standalone?

Thanks,
Shawn