2016-11-11 74 views
0

我在碎片和集合中有点混乱。我们可以使索引成为新分片的新表,并且可以像集合一样完成。何时使用collection vs shard?

何时制作新的碎片以及何时制作新的集合。

+0

重复https://stackoverflow.com/questions/35298435/understing-some-concepts-of-apache-solr/35299919#35299919的 – MatsLindh

+0

它不重复。在你的链接中,这些只是意味着我更专注于收集vs碎片,主要是在版本4中> –

+0

它们不是同一个概念。一个集合是_shards_的集合,它代表你的整个索引。如果您想要将集合扩展到更多服务器,请创建/分割新分片并将其移动。再平衡API可能对未来有所帮助。 – MatsLindh

回答

1

集合是SolrCloud集群中的完整逻辑索引。例如,您可能有三种不同的集合,分别称为用户,书籍和人物。

在逻辑层面上,整个索引被称为集合。这可能分布在集群中的许多节点上。

碎片是整个集合的一部分。即集合由一个或多个碎片组成。

何时使用收集?

Generally, users will create multiple Collections to separate logical units of data that will not be intermingled, similar to a database in the relational world. Collections are generally isolated from one another and do not typically communicate with each other. Also each Collections will each have their own unique schema.xml to define the types for their index.

当使用碎片?

If you feel your index is too big to be stored on one node . it can be divided into different shards and can be stored on different nodes on a cluster.

了解更多关于在这里:​​https://thinkbiganalytics.com/solrcloud-terminology/

+0

我们可以在一个分片中创建不同的模式 –

+0

没有。相同集合的分片将共享相同的模式。但是Collections将分别拥有自己独特的schema.xml来为其索引定义类型。 – root545

相关问题