gpt4 book ai didi

cassandra - cassandra 是否在 nodetool stopdaemon 上刷新内存表。如果不是如何避免数据丢失

转载 作者:行者123 更新时间:2023-12-03 23:18:36 24 4
gpt4 key购买 nike

我正在使用 apache-cassandra-3.10

我理解而不是 kill -9 pid ,优雅地阻止 cassandra 的唯一方法是 nodetool stopdaemon .

但我想知道是否 nodetool stopdaemon 还有冲洗 中的数据内存表 sstables 关机前。

如果它不刷新,则会导致 数据丢失 ,当我使用 nodetool stopdaemon 停止节点时。

同样在对此进行研究之后,我读到了 DURABLE_WRITES .持久写入实际上有什么作用?

此外,datastax 文档在 部分下说明设置 DURABLE_WRITES “不要使用 SimpleStrategy 在键空间上设置此属性”

引用:https://docs.datastax.com/en/cql/3.1/cql/cql_reference/create_keyspace_r.html

如果我的 keyspace 配置了 Simple Strategy ,我仍然无法受益于 DURABLE_WRITES 如果它可以帮助解决关机时的数据丢失问题?

正在手动运行 nodetool 刷新 在关机之前,确保我们不会在关机时丢失数据的唯一方法?

我读自 https://issues.apache.org/jira/browse/CASSANDRA-3564未添加关闭时刷新的功能。

还有一个关于同一问题的公开票
https://issues.apache.org/jira/browse/CASSANDRA-12001

目的是避免使用 nodetool stopdaemon 在关闭时丢失任何数据。考虑到使用中的简单策略,基本上在关闭之前刷新所有表。

最佳答案

nodetool drain就足够了。
来自 Datastax 文档关于 nodeool drain ,

Flushes all memtables from the node to SSTables on disk. Cassandra stops listening for connections from the client and other nodes. You need to restart Cassandra after running nodetool drain.
link: nodetool drain



然后你可以杀死或运行 nodetool stopdaemon .

关于cassandra - cassandra 是否在 nodetool stopdaemon 上刷新内存表。如果不是如何避免数据丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42926285/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com