cassandra - Cassandra 数据中心不同步 - 如何诊断和重建?
问题描述
我有三个 cassandra 数据中心,其键空间如下所示:
CREATE KEYSPACE allotments WITH replication = {'class': 'NetworkTopologyStrategy', 'hk1': '3', 'hk2': '3', 'hk3': '3'} AND durable_writes = false;
我最近安装了最新的集群 HK2 和 HK3,并将 auto_bootstrap 设置为 true(通过注释该行)。
然后,我继续使用原始数据中心 (HK1) 作为源在新数据中心(HK2 和 HK3)中的所有节点上运行重建命令:
nodetool rebuild -- hk1
但是,我发现自己遇到的问题是 HK2 似乎缺少数据,我无法找出原因或解决问题。
在 HK1 上(正确数据):
cqlsh> use allotments;
cqlsh:allotments> select count(*) from freesale_allotments;
count
-------
22035
(1 rows)
Warnings :
Aggregation query used without partition key
cqlsh:allotments>
在 HK2 上(缺少数据):
cqlsh:allotments> use allotments;
cqlsh:allotments> select count(*) from freesale_allotments;
count
-------
19142
(1 rows)
Warnings :
Aggregation query used without partition key
到目前为止尝试的故障排除步骤:
我尝试再次重建节点,重置本地数据。它只会在 2-3 秒内返回:
nodetool rebuild -m reset -- hk1
我尝试在所有节点上对密钥空间进行修复,大约 1 小时后成功完成,但计数保持不变。
nodetool repair allotments -pr
我已经尝试运行清理命令来清理所有损坏数据的表,并且再次 - 没有变化。
nodetool scrub
有人可以帮我指出正确的方向,以找出它是如何发生的,以及我将如何解决它。
非常感谢
马丁
解决方案
推荐阅读
- python-3.x - 在循环python中解析大型XML
- mongodb - 在 MongoDB 中允许 SSL 有效证书/无效主机名
- google-bigquery - 从 BigQuery SQL 中的日期获取 MONTH NAME
- php - 找不到类“PHPExcel_Worksheet_Protection”
- amazon-dynamodb - 如何为分层模型选择分区和排序键
- azure - 如何更新 VMSS 以使用 Azure 中的现有 LB
- java - JAVA Servlet 的电子邮件推送身份验证
- javascript - 无法正确解析 JSON 对象
- swift - Reality Composer 和处理多个表面
- android - 如何避免不必要的api调用,只有在服务器端发生一些变化时才执行api调用