如何使用不同的机器配置在 Cassandra 中添加新节点

How to add new nodes in Cassandra with different machine configuration

我在两个数据中心有 6 个 cassandra 节点,内存为 16GB,硬盘为 1TB。

现在我要添加 3 个节点和 32GB 内存。这些机器是否会对现有机器造成开销(可能在令牌分配中)?如果是,请建议如何配置这些机器以避免这些问题。

提前致谢。

节点之间的 "balance" 最好使用 vnodes 进行调节。如果你还记得(如果你不记得,你应该 read about it), the ring that Cassandra nodes form is actually consisted out of virtual nodes (vnodes). Each node in the ring has a certain portion of vnodes, which is set up in the Cassandra configuration on each node. Based on that number of vnodes, or rather the proportion between them, the amount of data going to those nodes is calculated. The configuration you are looking for is num_tokens。如果你有类似强大的机器,那么一个相等的 vnode 数量是可用的。默认是 256。

添加新的、功能更强大的机器时,您应该为其分配更多的 vnode。多少?我觉得很难说。多给它两倍是不明智的,只看内存,因为这些节点的数据量是其他节点的两倍。比您预期的更多 IO 操作(请记住,您仍然拥有相同的 HDD)和 CPU 利用率(以及相同的 CPU)。 You might want to take a look at this answer also.