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 Tyrone Tse <ty...@hotmail.com> on 2020/09/03 17:14:11 UTC

Solr Cloud Query when one of the Solr instances goes down

I have setup the example Solr Cloud that comes with the built in Zoo Keeper
that runs on localhost:9993.

I created my Solr Cloud instance with 2 nodes.
Node 1 url is http://localhost:8983/solr/#/~cloud
Node 2 url is http://localhost:7574/solr/#/~cloud

Currently all Solr queries go through Node 1
http://localhost:8983/solr/files/select?q=*%3A*

Is there a way to query solr cloud collections though the Zoo Keeper or
common host:port
So that if node 1 or node 2 goes down.
The Solr query will still work, so I don't have to change the Solr
host:port in the query if one solr node goes down?

Currently in our Java application, if Solr 1 is going to brought down for
maintenance, then the our solr configuration file solr url property has to
be changed to from http://localhost:8983  to http://localhost:7574

Thanks
Tyrone

Re: Solr Cloud Query when one of the Solr instances goes down

Posted by Jeffrey McCallum <jm...@forensiclogic.com>.
Hi Tyrone,
We use an external load balancer across the nodes.

If you use the java client you can query the zookeepers

https://lucene.apache.org/solr/guide/7_1/solrcloud-query-routing-and-read-tolerance.html
SolrCloud Query Routing And Read Tolerance | Apache Solr Reference Guide 7.1<https://lucene.apache.org/solr/guide/7_1/solrcloud-query-routing-and-read-tolerance.html>
A Solr node will return the results of a search request as long as it can communicate with at least one replica of every shard that it knows about, even if it can not communicate with ZooKeeper at the time it receives the request. This is normally the preferred behavior from a fault tolerance standpoint, but may result in stale or incorrect results if there have been major changes to the ...
lucene.apache.org

Read Side Fault Tolerance<https://lucene.apache.org/solr/guide/7_1/solrcloud-query-routing-and-read-tolerance.html#read-side-fault-tolerance>

In a SolrCloud cluster each individual node load balances read requests across all the replicas in collection. You still need a load balancer on the 'outside' that talks to the cluster, or you need a smart client which understands how to read and interact with Solr’s metadata in ZooKeeper and only requests the ZooKeeper ensemble’s address to start discovering to which nodes it should send requests. (Solr provides a smart Java SolrJ client called CloudSolrClient<https://lucene.apache.org/solr/7_1_0//solr-solrj/org/apache/solr/client/solrj/impl/CloudSolrClient.html>.)

Hope it helps.






[cid:ee5928bc-8841-4ba1-9750-6051d036412b]

Jeff McCallum

Software Test / DevOps

Forensic Logic / COPLINK

Office: 520-367-2844

email: jmccallum@forensiclogic.com

www.forensiclogic.com<http://www.forensiclogic.com/>

________________________________
From: Tyrone Tse <ty...@hotmail.com>
Sent: Thursday, September 3, 2020 10:14 AM
To: solr-user@lucene.apache.org <so...@lucene.apache.org>
Subject: Solr Cloud Query when one of the Solr instances goes down

I have setup the example Solr Cloud that comes with the built in Zoo Keeper
that runs on localhost:9993.

I created my Solr Cloud instance with 2 nodes.
Node 1 url is http://localhost:8983/solr/#/~cloud
Node 2 url is http://localhost:7574/solr/#/~cloud

Currently all Solr queries go through Node 1
http://localhost:8983/solr/files/select?q=*%3A*

Is there a way to query solr cloud collections though the Zoo Keeper or
common host:port
So that if node 1 or node 2 goes down.
The Solr query will still work, so I don't have to change the Solr
host:port in the query if one solr node goes down?

Currently in our Java application, if Solr 1 is going to brought down for
maintenance, then the our solr configuration file solr url property has to
be changed to from http://localhost:8983  to http://localhost:7574

Thanks
Tyrone