2

I have to setup two solr servers, so that if one of the servers goes offline, traffic can be switched to the other server at runtime.

One way is to let Solr try to connect to the server and after it times out try connecting with the other server. Is there a better way of doing this? Using 'try..catch' method takes a long time, so if there isn't a better way then is there a faster way to use 'try..catch' method?

Thanks

Raza
  • 139
  • 3
  • 13

1 Answers1

3

You might want to try using a regular HTTP load balancer for this, such as HAProxy or Varnish. This has the advantage of being completely transparent to your application.

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
  • Thanks Mauricio, I will look into using load balancer for this. – Raza Nov 08 '11 at 00:57
  • How about writes? Who will replicate writes to all the nodes? – Eugene D. Gubenkov Apr 13 '15 at 12:27
  • @EugeneD.Gubenkov -- ZooKeeper still handles the write replication and query distribution, even with a standard HTTP load balancer in front. This article has a good diagram of the set-up: http://thinkbig.teradata.com/solrcloud-terminology/ – LandonC Jun 09 '15 at 18:27
  • @LandonC, yeah, thank you! I thought Mauricio meant just "pure" Solr instances under load balancer. – Eugene D. Gubenkov Jun 09 '15 at 18:55