问题
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
回答1:
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.
来源:https://stackoverflow.com/questions/8013810/solrnet-how-to-switch-solr-connection-to-another-server-if-the-currently-used-s