SolrNet:如果当前使用的服务器关闭,如何将Solr连接切换到另一个服务器? [英] SolrNet: How to switch Solr connection to another server if the currently used server goes down?

查看:375
本文介绍了SolrNet:如果当前使用的服务器关闭,如何将Solr连接切换到另一个服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须设置两个solr服务器,这样,如果其中一个服务器脱机,流量可以在运行时切换到另一个服务器。

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.

一种方法是让Solr尝试连接到服务器,超时后尝试与其他服务器连接。有没有更好的方法这样做?使用'try..catch'方法需要很长时间,所以如果没有更好的方法,那么是否有更快的方法使用try..catch方法?

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?

感谢

推荐答案

您可能想尝试使用一般的HTTP负载平衡器,例如 HAProxy Varnish 。这具有对您的应用程序完全透明的优点。

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.

这篇关于SolrNet:如果当前使用的服务器关闭,如何将Solr连接切换到另一个服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆