简体   繁体   English

Cassandra 删除键空间,表不工作

[英]Cassandra drop keyspace, tables not working

I am starting with cassandra and have had some problems.我从 cassandra 开始并且遇到了一些问题。 I create keyspaces and tables to go playing, if I delete them and then run a describe keyspace they keep appearing to me.我为 go 播放创建键空间和表,如果我删除它们然后运行describe keyspace ,它们会一直出现在我面前。 Other times I delete them and it tells me they don't exist, but I can't create them either because it says it exists.其他时候我删除它们,它告诉我它们不存在,但我也无法创建它们,因为它说它存在。

Is there a way to clear that "cache" or something similar?有没有办法清除“缓存”或类似的东西?

I would also like to know if through cqlsh I can execute a.cql file that is on my computer.我还想知道是否可以通过 cqlsh 执行我计算机上的一个 .cql 文件。

[cqlsh 5.0.1 | Cassandra 3.11.0 | CQL spec 3.4.4 | Native protocol v4]

This may be due to the eventually consistent nature of Cassandra.这可能是由于 Cassandra 的最终一致性质。 If you are on a small test cluster and just playing around you could try doing CONSISTENCY ALL in cqlsh which will force the nodes to become consistent.如果您在一个小型测试集群上并且只是在玩耍,您可以尝试在 cqlsh 中执行 CONSISTENCY ALL,这将强制节点变得一致。

You should always run delete or drop command manually with CONSISTENCY ALL so that it will reflect all the nodes and DCs.您应该始终使用 CONSISTENCY ALL 手动运行删除或删除命令,以便它反映所有节点和 DC。 Also you need to wait for a moment to replicate into the cluster.您还需要等待片刻才能复制到集群中。 Once replicated you will not get deleted data else you need to run a repair in the cluster.复制后,您将不会获得已删除的数据,否则您需要在集群中运行修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM