我们可以截断 cassandra 中的表吗,如果任何一个节点关闭

Can we truncate tables in cassandra, If any one of the node is down

在我的项目中,我将 Cassandra 用于数据库,为此创建了 3 个节点。这里的问题有时是由于磁盘 space 问题,其中一个节点正在关闭,当时我试图截断表,但我无法截断它们,我得到类似 CONSISTENCY LEVEL 相关问题。所以我正在做的是,我将一些数据移动到另一个位置,然后重新启动 cassandra,一旦它启动,我就会截断表格。我的问题是,如果不创建一个节点 up(共 3 个节点),我们可以截断表吗?

您需要所有可用的节点,否则命令将失败。

TRUNCATE sends a JMX command to all nodes, telling them to delete SSTables that hold the data from the specified table. If any of these nodes is down or doesn't respond, the command fails and outputs a message like the following:

https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlTruncate.html