How to find if solr server is running or not

I am running an application that receives search results from the solr server. But when the server is down, I get no response from the server. Is there a way that I can detect that my server is not working so that I can give the correct error message related to it.

+7
source share
4 answers

You can periodically ping your server (for example, http://localhost:8983/solr/admin/ping ), and in case of an error send this message to the external interface ...

+9
source

If the server does not respond in a timely manner (solr), then you should consider submitting it down and presenting an error message regardless of whether it is or not (i.e. it takes a lot of time because it is overloaded). If loading the user forever leaves :)

Most solr clients have timeout and error callbacks. If a timeout occurs, you will see an error.

If you want to find out very quickly that the server is turned off, you can put the JSP in solr, which does nothing but print a message. Then do an HTTP GET for the JSP, and if it doesn't work very fast then the server will be unavailable.

+1
source

You should probably use something like Nagios to monitor the status of your equipment. Nagios also has a nice solr plugin that can help you.

0
source

If you have a SolrServer object, just call SolrServer.ping() , it throws an exception if the connection cannot be established.

0
source

All Articles