Solr 存储处理

Solr storage handling

我有六个节点的 solr 集群,每个节点都有 200GB 的存储空间,我们创建了一个包含两个分片的集合。

我想知道如果我的文档达到 400GB (node1-200GB,node-2 200GB) 会怎样? solr 会自动使用我集群中的另一个空闲节点吗?

  1. 如果我的文档达到400GB(node1-200GB,node-2 200GB)?

Ans:我不确定你会得到什么具体的错误,但是在生产中你应该尽量不要面对这种情况。对于 avoid/handle 这样的场景,我们有 monitoring/autoscaling triggers 个 API。

  1. solr 是否自动使用我集群中的另一个空闲节点?

Ans:不,不会自动添加额外的分片。但是,每当您发现搜索速度变慢或者 solr 正在跨越机器的物理限制时,您应该选择 splitShard

所以最终您可以使用自动缩放触发器来处理这个问题。也就是说,您可以设置 autscaling 触发器 来识别分片是否超过了有关文档数量或索引大小等的指定限制。一旦达到此限制,此触发器就可以调用 splitShard

This link 提及

This trigger can be used for monitoring the size of collection shards, measured either by the number of documents in a shard or the physical size of the shard’s index in bytes.

When either of the upper thresholds is exceeded the trigger will generate an event with a (configurable) requested operation to perform on the offending shards - by default this is a SPLITSHARD operation.