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 Romi <ro...@gmail.com> on 2011/07/19 11:09:03 UTC

How to find whether solr server is running or not

I am running an application that get search results from solr server. But
when server is not running i get no response from the server. Is there any
way i can found that my server is not running so that i can give proper
error message regarding it


-----
Thanks & Regards
Romi
--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-find-whether-solr-server-is-running-or-not-tp3181870p3181870.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to find whether solr server is running or not

Posted by Chanty <cs...@gmail.com>.
i am new in HADOOP TESTING , any body tell me about the hadoop  testing ,
what  should be sufficient  for a tester  to  test  hadoop   based projects
. please help  me

--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-find-whether-solr-server-is-running-or-not-tp3181870p3182201.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to find whether solr server is running or not

Posted by Erick Erickson <er...@gmail.com>.
Try doing this from a program rather than the browser. If Solr isn't
running, you have to infer that fact from the lack of a response.

Best
Erick

On Tue, Jul 19, 2011 at 7:42 AM, Romi <ro...@gmail.com> wrote:
> But the problem is when solr server is not runing
> *"http://host:port/solr/admin/ping"*
>
> will not give me any json response
> then how will i get the status :(
>
> when i run this url browser gives me following error
> *Unable to connect
> Firefox can't establish a connection to the server at 192.168.1.9:8983.*
>
> -----
> Thanks & Regards
> Romi
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-find-whether-solr-server-is-running-or-not-tp3181870p3182202.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: How to find whether solr server is running or not

Posted by Romi <ro...@gmail.com>.
François Schiettecatte, how will i get 200 status code. I am getting json
response from solr server, 
as 
*$.getJSON("http://192.168.1.9:8983/solr/db/select/?qt=dismax&wt=json&&start=0&rows=100&q="elegant"&hl=true&hl.fl=text&hl.usePhraseHighlighter=true&sort=
score&json.wrf=?", function(result){
*

but if solr server is not running this code does not execute...how can i
check than that server is not running

-----
Thanks & Regards
Romi
--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-find-whether-solr-server-is-running-or-not-tp3181870p3184556.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to find whether solr server is running or not

Posted by François Schiettecatte <fs...@gmail.com>.
I think anything but a 200 OK mean it is dead like the proverbial parrot :)

François

On Jul 19, 2011, at 7:42 AM, Romi wrote:

> But the problem is when solr server is not runing 
> *"http://host:port/solr/admin/ping"*
> 
> will not give me any json response
> then how will i get the status :(
> 
> when i run this url browser gives me following error
> *Unable to connect
> Firefox can't establish a connection to the server at 192.168.1.9:8983.*
> 
> -----
> Thanks & Regards
> Romi
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-find-whether-solr-server-is-running-or-not-tp3181870p3182202.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: How to find whether solr server is running or not

Posted by Romi <ro...@gmail.com>.
But the problem is when solr server is not runing 
*"http://host:port/solr/admin/ping"*

will not give me any json response
then how will i get the status :(

when i run this url browser gives me following error
*Unable to connect
Firefox can't establish a connection to the server at 192.168.1.9:8983.*

-----
Thanks & Regards
Romi
--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-find-whether-solr-server-is-running-or-not-tp3181870p3182202.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to find whether solr server is running or not

Posted by Péter Király <ki...@gmail.com>.
You can use ping:
http://host:port/solr/admin/ping

The response is something like this:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int
name="QTime">5</int><lst name="params"><str
name="echoParams">all</str><str name="rows">10</str><str
name="echoParams">all</str><str name="q">solrpingquery</str><str
name="qt">search</str></lst></lst><str name="status">OK</str>
</response>

or with JSON response:
http://host:port/solr/admin/ping?wt=json
{"responseHeader":{"status":0,"QTime":2,"params":{"echoParams":"all","rows":"10","echoParams":"all","q":"solrpingquery","qt":"search","wt":"json"}},"status":"OK"}

Hope this helps.
Péter

-- 
eXtensible Catalog
http://drupal.org/project/xc

2011/7/19 Romi <ro...@gmail.com>:
> i am getting json response from solr as
>
> *$.getJSON("http://192.168.1.9:8983/solr/db/select/?qt=dismax&wt=json&&start=0&rows=100&q="elegant"&hl=true&hl.fl=text&hl.usePhraseHighlighter=true&sort=
> score&json.wrf=?", function(result){*
>
> how can i check whether i get response or not
>
>
>
>
> -----
> Thanks & Regards
> Romi
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-find-whether-solr-server-is-running-or-not-tp3181870p3181942.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: How to find whether solr server is running or not

Posted by Romi <ro...@gmail.com>.
i am getting json response from solr as

*$.getJSON("http://192.168.1.9:8983/solr/db/select/?qt=dismax&wt=json&&start=0&rows=100&q="elegant"&hl=true&hl.fl=text&hl.usePhraseHighlighter=true&sort=
score&json.wrf=?", function(result){*

how can i check whether i get response or not




-----
Thanks & Regards
Romi
--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-find-whether-solr-server-is-running-or-not-tp3181870p3181942.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to find whether solr server is running or not

Posted by Mohammad Shariq <sh...@gmail.com>.
Check for HTTP response code, if its other than 200 means services are not
OK.

On 19 July 2011 14:39, Romi <ro...@gmail.com> wrote:

> I am running an application that get search results from solr server. But
> when server is not running i get no response from the server. Is there any
> way i can found that my server is not running so that i can give proper
> error message regarding it
>
>
> -----
> Thanks & Regards
> Romi
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/How-to-find-whether-solr-server-is-running-or-not-tp3181870p3181870.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Thanks and Regards
Mohammad Shariq