SolrNet: How to switch Solr connection to another server if the currently used server goes down?

坚强是说给别人听的谎言 提交于 2019-12-11 01:52:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!