SolrCloud负载平衡 [英] SolrCloud load-balancing
问题描述
我正在研究一个使用Solr作为搜索引擎的.NET应用程序.我已经配置了具有两台服务器的SolrCloud安装(其中一台用于副本服务器),并且没有将索引拆分为碎片(碎片数= 1).我已经读过SolrCloud(通过Zookeeper)可以实现一些负载平衡,但是我不知道该如何做.如果调用的是在其中部署了solr实例的特定地址,则查询仅出现在该特定服务器的日志上.
i'm working on a .NET application that uses Solr as Search Engine. I had configured a SolrCloud installation with two server (one for Replica) and i didn't split the index in shards (number of shards = 1). I have read that SolrCloud (via Zookeeper) can do some load balancing, but i didn't understand how. If a call a specific address where an instance of solr is deployed, the query appears only on the logs of that specific server.
在SolrCloud的文档中,我发现:
On the documentation of SolrCloud i've found that:
明确指定要查询的分片的地址,并提供用于负载平衡和故障转移的替代方法(由|分隔):
Explicitly specify the addresses of shards you want to query, giving alternatives (delimited by |) used for load balancing and fail-over:
我想知道是否可以使用这种表示法来强制负载均衡,如果一个索引具有完整的索引(只有一个分片),并且在这种情况下负载均衡器如何工作.
I'm wondering if i can use this notation to force load balancing also if a have an entire index (only one shard) and in that case how the load-balancer works.
更新:我已经测试了此解决方案,并且可以正常工作.在由字符"|"分隔的碎片"字段中添加各种碎片地址强制Solr调用内部负载平衡器(LBHttpSolrServer),该负载平衡器执行简单的循环平衡.
UPDATE: I've tested this solution and it works. Adding the various shard addresses in the field "shards" separated by the character "|" forces Solr to call the internal load balancer (LBHttpSolrServer) that performs a simple round robin balancing.
感谢您的帮助.
关于, 哈科波
推荐答案
我已经测试了此解决方案,并且可以正常工作.在由字符"|"分隔的碎片"字段中添加各种碎片地址强制Solr调用内部负载平衡器(LBHttpSolrServer),该负载平衡器执行简单的循环平衡.
I've tested this solution and it works. Adding the various shard addresses in the field "shards" separated by the character "|" forces Solr to call the internal load balancer (LBHttpSolrServer) that performs a simple round robin balancing.
这篇关于SolrCloud负载平衡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!