使用中国数据中心扩展 Cassandra 集群 (CGF)

Extending Cassandra cluster with datacenter in China (CGF)

我需要用一个新的数据中心来扩展我的集群,以便在中国大陆的防火墙后面。目前我在美国和欧洲都有数据中心 - 所以集群已经符合 Geographical Location Scenario.

的要求

至此我已经为Cassandra准备好了中文基础设施,但是这几天的网络统计有点麻烦,我有点害怕:if and how this可以影响我当前的集群 并且新的数据中心会完全正常运行吗?

我对此的实际问题是:

欢迎任何建议或评论,谢谢!

How does Cassandra handle huge packet-loss during replication? (occasionally up to 40%)

通常丢包会引起大量读修复。在某些情况下,它可能会导致请求失败,具体取决于复制因子和一致性。此外,准备好进行非常昂贵的维修,这将产生大量微小的 SSTable 和大量的 IO。

我建议 运行 对开发需求进行测试,以查看系统中的实际行为。有很多tools模拟不良网络。

How does it effect the cluster when the network connection between two datacenters are really bad (only few kilobits/sec and latency as above) for hours? Will the chinese dc considered as dead? Or Cassandra will still try to use the limited bandwidth? Can this cause any problem on the non-chinese datacenters?

这在很大程度上取决于 有多糟糕 以及你的一致性 level/replication 因素 运行。在某些情况下,它只会导致集群之间相当高的延迟。但是,如果连接非常糟糕,节点将开始将另一个节点标记为关闭 - 那么您正在查看所有数据中心的问题。您现有的数据中心将因请求超时而导致性能下降。这反过来会导致请求在内存中保留更长时间,从而导致 GC。 (它也会在您的其他集群中引起许多其他问题)

可以调整和微调故障检测器的灵敏度阈值以适合您的用例。 phi_convict_threshold 是一个可以降低节点被标记为关闭的可能性的设置。您可以找到更多相关信息 here。如果您发现您的节点由于无响应而未被标记为最佳点,您可以让 Cassandra 充分利用它必须处理的一切。

Is it possible to enforce somehow, that only one of my non-chinese datacenter communicates with the chinese one? Or should I trust that Cassandra will handle this? (trying to avoid to possible harm all my datacenters)

并没有真正的方法告诉 Cassandra 限制可以访问的数据中心。您有点难以在复制因子中包含的数据中心之间进行通信。

Is there any way to fasten up the initial data replication (nodetool rebuild), because with the current speed it would take weeks to replicate our current data.

我不建议使用 sstableloader 的解决方案,因为它的功能与重建非常相似,并且需要快照才能运行。如果网络是导致速度慢的原因,那么改变流式传输方式不会有太大区别。

在我看来,首先要做的是测量系统的瓶颈所在。如果慢速网络确实是瓶颈,可以添加更多节点以同时从更多源流式传输,但最终您仍然会受到慢速网络连接的阻碍。