【问题标题】:Cassandra: Data loss after adding new nodeCassandra:添加新节点后数据丢失
【发布时间】:2015-05-14 12:21:45
【问题描述】:

我们有一个两个节点的 cassandra 集群,我们希望将其扩展到四个。 我们遵循了那里描述的程序:http://www.datastax.com/documentation/cassandra/1.2/cassandra/operations/ops_add_node_to_cluster_t.html

但是在再添加两个节点后(同时,按照文档中的建议间隔 2 分钟),我们遇到了一些数据丢失。在某些列族中,缺少元素。

这里是nodetool netstats

[centos@ip-10-11-11-187 ~]$ nodetool status
Datacenter: us-west-2
=====================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address       Load       Tokens  Owns    Host ID                               Rack
UN  10.11.11.187  5.63 MB    256     ?       0e596912-d649-4eed-82a4-df800c422634  2c
UN  10.11.1.104   748.79 MB  256     ?       d8b96739-0858-4926-9eb2-27c96ca0a1c4  2c
UN  10.11.11.24   7.11 MB    256     ?       e3e76dcf-2c39-42e5-a34e-9e986d4a9f7c  2c
UN  10.11.1.231   878.91 MB  256     ?       cc1b5cfd-c9d0-4ca9-bbb1-bce4b2deffc1  2c

Note: Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless

我不太明白“笔记”是不是坏的。

当我们添加节点时,我们将集群中已经可用的两台服务器放入第一个添加节点的配置种子中。对于第二个添加的节点,我们也将新添加的节点放入种子中。

我们使用的是EC2Snitch,而listen_address已经在每台服务器上设置为上述地址。

我们还没有运行清理,但我们尝试运行修复,并且写在我们的键帽中没有需要修复的内容。

我们的集群是这样创建的:

CREATE KEYSPACE keyspace_name WITH replication = {'class': 'NetworkTopologyStrategy', 'us-west-2': '1'}  AND durable_writes = true;

以及我们所有表格的选项:

CREATE TABLE keyspace_name."CFName" (
    // ...
) WITH bloom_filter_fp_chance = 0.01
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
    AND comment = ''
    AND compaction = {'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32'}
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99.0PERCENTILE';

如果我停用新节点,数据会重新出现。

编辑:阅读文档时实际上是一个错误...一位同事确实将 auto_bootstrap 设置为 false 而不是将其设置为 true...

【问题讨论】:

    标签: cassandra cassandra-2.0


    【解决方案1】:

    使用 auto_bootstrap: false 添加新节点后,您应该在新节点上执行nodetool rebuild

    http://www.datastax.com/documentation/cassandra/2.0/cassandra/tools/toolsRebuild.html

    HTH

    【讨论】:

    • 酷,我不知道这个选项。我终于从集群中停用了该节点,然后将其添加回来并且它工作了。谢谢!
    【解决方案2】:

    你可以指定键空间名称来删除节点,在这种情况下是

    nodetool status keyspace_name
    

    【讨论】:

      猜你喜欢
      • 2020-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-09
      相关资源
      最近更新 更多