SolrCloud 负载均衡 [英] SolrCloud load-balancing

查看:25
本文介绍了SolrCloud 负载均衡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用 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:

http://www.ipaddress.com:8983/solr/collection1/select?shards=www.ipaddress.com:8983/solr|www.ipaddress.com:8900/solr,www.ipaddress.com:7574/solr|www.ipaddress.com:7500/solr

我想知道如果有一个完整的索引(只有一个分片)以及在这种情况下负载平衡器是如何工作的,我是否可以使用这个符号来强制负载平衡.

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.

更新:我已经测试了这个解决方案并且它有效.在字段shards"中添加各种分片地址,以字符|"分隔强制 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.

感谢您的帮助.

问候,雅各布

推荐答案

我已经测试了这个解决方案并且它有效.在字段shards"中添加各种分片地址,以字符|"分隔强制 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屋!

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