Hazelcast:使用集群组时如何对数据进行分区?

Hazelcast: how data is partitioned when using Cluster Groups?

Hazelcast 文档中提到了 集群组:

You can create cluster groups. To do this, use the group configuration element.

By specifying a group name and group password, you can separate your clusters in a simple way. Example groupings can be by development, production, test, app, etc. <...> Each Hazelcast instance can only participate in one group. Each Hazelcast instance only joins to its own group and does not interact with other groups.

<...>

The cluster members (nodes) and clients having the same group configuration (i.e., the same group name and password) forms a private cluster.

Each cluster will have its own group and it will not interfere with other clusters.

但是没有关于数据分区的细节。

如果我有 5 个节点和 2 个集群组:

是不是说GroupA的数据不会存储在node4和node5?

是的,就是这个意思。这些组是独立的集群,没有任何共同点(可能除了网络 ;-))。

如果您寻求数据分区,Hazelcast 会根据键分发信息,但您可以通过利用数据亲和力来产生某种影响 (http://docs.hazelcast.org/docs/3.8/manual/html-single/index.html#data-affinity)。

如果您正在寻找备份分发,您可能对分区组 (http://docs.hazelcast.org/docs/3.8/manual/html-single/index.html#partition-group-configuration) 感兴趣。