Solr AutoScaling-在新节点上添加副本 [英] Solr AutoScaling - Add replicas on new nodes

查看:234
本文介绍了Solr AutoScaling-在新节点上添加副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Solr版本7.3.1
从3个节点开始:

Using Solr version 7.3.1
Starting with 3 nodes:

我创建了这样的收藏夹:

I have created a collection like this:

wget "localhost:8983/solr/admin/collections?action=CREATE&autoAddReplicas=true&collection.configName=my_col_config&maxShardsPerNode=1&name=my_col&numShards=1&replicationFactor=3&router.name=compositeId&wt=json" -O /dev/null

这样,我在每个节点上都有一个副本.

In this way I have a replica on each node.

目标:

  • 每个分片都应将副本添加到加入集群的新节点中.
  • 当一个节点被击落时.它应该消失了.
  • 每个节点上每个分片只有一个副本.

我知道使用新的自动调用API ,但是我很难找到正确的语法.该API非常新,我只能找到文档.这还不错,但我错过了更多的例子.

I know that it should be possible with the new AutoScalling API but I am having a hard time finding the right syntax. The API is very new and all I can find is the documentation. Its not bad but I am missing some more examples.

这就是今天的样子.有许多小分片,每个小分片的复制因子都与节点数相匹配.现在有3个节点.

This is how its looks today. There are many small shard each with a replication factor that match the numbers of nodes. Right now there are 3 nodes.

该视频昨天已上传( 2018-06-13)和大约30分钟.视频中有一个Solr.HttpTriggerListener的示例,可用于调用任何类型的服务,例如,用于添加新节点的AWS Lamda.

This video was uploaded yesterday (2018-06-13) and around 30 min. into the video there is an example of the Solr.HttpTriggerListener that can be used to call any kind of service, for example an AWS Lamda to add new nodes.

推荐答案

简而言之,就是今天无法实现您的目标(直到Solr 7.4).

The short answer is that your goals are not not achievable today (till Solr 7.4).

NodeAddedTrigger仅将副本从其他节点移动到新节点,以尝试平衡群集.它不支持添加新副本.我已打开 SOLR-12715 添加此功能.

The NodeAddedTrigger only moves replicas from other nodes to the new node in an attempt to balance the cluster. It does not support adding new replicas. I have opened SOLR-12715 to add this feature.

类似地,NodeLostTrigger在其他节点上添加新副本以替换丢失的节点上的副本.它也不支持仅从集群状态删除副本.我已经打开 SOLR-12716 来解决该问题.我希望在Solr 7.5中发布这两个增强功能.

Similarly, the NodeLostTrigger adds new replicas on other nodes to replace the ones on the lost node. It, too, has no support for merely deleting replicas from cluster state. I have opened SOLR-12716 to address that issue. I hope to release both the enhancements in Solr 7.5.

第三个目标:

每个节点上每个分片只有一个副本.

Only one replica for each shard on each node.

要实现这一目标,请在"限制副本位置"示例就足够了.但是,查看您发布的屏幕快照,实际上是指(收藏夹,碎片)对,今天不支持该对.您将需要类似以下的策略规则(以下操作无效,因为不支持collection:#EACH):

To achieve this, a policy rule given in the "Limit Replica Placement" example should suffice. However, looking at the screenshot you've posted, you actually mean a (collection,shard) pair which is unsupported today. You'd need a policy rule like the following (following does not work because collection:#EACH is not supported):

{"replica": "<2", "collection": "#EACH", "shard": "#EACH", "node": "#ANY"}

我已经打开 SOLR-12717 来添加此功能.

I have opened SOLR-12717 to add this feature.

感谢您提供这些出色的用例.我建议在 solr-用户邮件列表,因为不是很多Solr开发人员都经常使用Stackoverflow.我只能找到此问题,因为它已发布在 docker-solr 上项目.

Thank you for these excellent use-cases. I'll recommend asking questions such as these on the solr-user mailing list because not a lot of Solr developers frequent Stackoverflow. I could only find this question because it was posted on the docker-solr project.

这篇关于Solr AutoScaling-在新节点上添加副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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