验证Cassandra节点同步的方法 [英] Methods to Verify Cassandra Node Sync

查看:39
本文介绍了验证Cassandra节点同步的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个3节点的Cassandra群集,其复制因子为2。
因为其中一个节点已被新节点替换。
而且我用过 nodetool repair来修复所有键空间。
但是不知道如何验证所有键空间是否已同步。

I have a 3 node Cassandra cluster with replication factor of 2. Because one of the nodes has been replaced with a new one. And I have used "nodetool repair" to repair all the keyspaces. But don't know how to verify that all the keyspaces are synced.

在此之前,Just发现本文会有所帮助,但有一点帮助。
Cassandra数据复制问题

Before, Just found this article would help, but a little. Cassandra Data Replication problem

在Cassandra中有没有办法验证复制因子> 1的键空间?

Is there any way to verify the keyspaces with replication factor > 1 in Cassandra?

非常感谢。

stephon

推荐答案

首先,如果再次运行nodetool repair,并且传输的数据很少(假设所有节点都已启动)自上次运行以来),您知道数据几乎完全同步。您可以查看日志以了解在此过程中传输了多少数据。

First, if you run nodetool repair again and very little data is transferred (assuming all nodes have been up since the last time you ran), you know that the data is almost perfectly in sync. You can look at the logs to see numbers on how much data is transferred during this process.

第二,您可以验证所有节点都获得了相似数量的通过使用nodetool cfstats查看写入计数来进行写入。请注意,每次Cassandra重新启动时,写入计数值都会重置,因此,如果未在同一时间重新启动它们,则必须查看它们随着时间增加的速度。

Second, you can verify that all of the nodes are getting a similar number of writes by looking at the write counts with nodetool cfstats. Note that the write count value is reset each time Cassandra restarts, so if they weren't restarted around the same time, you'll have to see how quickly they are each increasing over time.

最后,如果您只想检查一些最近更新的值,则可以尝试以一致性级别ONE读取这些值。如果您始终获得最新版本的数据,您就会知道这些副本很可能是同步的。

Last, if you just want to spot check a few recently updated values, you can try reading those values at consistency level ONE. If you always get the most up-to-date version of the data, you'll know that the replicas are likely in sync.

一般来说,复制是Cassandra如此根深蒂固的部分,以至于没有您的注意,它极不可能自行失败。通常,问题开始后不久,节点将被标记为down。另外,我假设您的写作一致性等级为ONE或ANY;更高的内容,您肯定会知道两个副本都收到了写入。

As a general note, replication is such an ingrained part of Cassandra that it's extremely unlikely to fail on its own without you noticing. Typically a node will be marked down shortly after problems start. Also, I'm assuming you're writing at consistency level ONE or ANY; with anything higher, you know for sure that both of the replicas have received the write.

这篇关于验证Cassandra节点同步的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆