0

i have 8 solr shards running along with 3 zookeepers, some times if any of the servers fails it give me the following stacktrace, i can handle that with shards.tolerant=true in query.

My question is how to make this fault tolerant by default in solr cloud so whenever i fire query it will return few guaranteed result and not exception ?

ERROR - 2014-09-02 12:01:45.610; org.apache.solr.common.SolrException; org.apache.solr.common.SolrException: no servers hosting shard: 
    at org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:149)
    at org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:119)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Amey Jadiye
  • 3,066
  • 3
  • 25
  • 38

2 Answers2

0

This can happen if your shard is down. Is any shard down due to that node?
How many replicas do you have?

LoadBalancing:
CloudSolrServer client takes care of Load Balancing if you use it. In a Solr Cloud the queries are distributed.

techuser soma
  • 4,766
  • 5
  • 23
  • 43
  • Hi , yes one shard is down thats why i am getting this error....i have only 8 shards they all are leader,cloud have around 70 million document and 2TB space ,no replicas...what would you like to suggest? – Amey Jadiye Sep 02 '14 at 18:10
  • Create at least 2 replicas to over come losing one node. – techuser soma Sep 02 '14 at 18:16
  • 1
    as @AmeyJadiye suggested. create at least 2 replicas. if any of them replica down you can perform opertion. by solr cloud behaviour it's not fair to querying or indexing having a only single replica if it's down. having a single replica wiht down status it means whole shard down. so solr will never get the replica to perform write or read operation. – Rushi Kadivar Aug 10 '22 at 05:44
  • considering a performence you can use more than one replicas with different type of replicas mentioned here [types pf replicas solrcloud 8.11] (https://solr.apache.org/guide/8_11/shards-and-indexing-data-in-solrcloud.html#types-of-replicas) – Rushi Kadivar Aug 10 '22 at 05:47
0

To set up High Availability in Solr Cloud, you would need at least 2 Solr instances. When you create your collection, specify the number of shards and the replication factor, SolrCloud will create mirrored shards on each replica for you when this is done. You can also confirm that it works in the Cloud view.

At this point, you would simply index data into Solr as before and it would be automatically sent to the "leader" instance, then replicated to the mirrored instance.

When a query comes in, regardless what node receives it, it will be bounced around in the SolrCloud automatically to hit an instance of a given shard, then the results will be aggregated and sent back to the client.

nick_v1
  • 1,654
  • 1
  • 18
  • 29