使用cassandra-cli,尝试修改CompositeType比较器(例如,添加或删除字段)失败,并显示错误:
[default@KS] describe CF;
ColumnFamily: CF
Cells sorted by:
org.apache.cassandra.db.marshal.CompositeType(
org.apache.cassandra.db.marshal.LongType,
org.apache.cassandra.db.marshal.LongType,
org.apache.cassandra.db.marshal.UTF8Type)
[default@KS] truncate CF;
CF truncated.
[default@KS] update column family CF with comparator =
'CompositeType(
org.apache.cassandra.db.marshal.LongType,
org.apache.cassandra.db.marshal.UTF8Type)';
comparators do not match or are not compatible.
通过删除和重新创建列系列来解决此问题的尝试工作正常,直到重新启动,显然是由此问题引起的: cassandra Exception encountered during startup: index (1) must be less than size (1)
如何正确处理此案件?我想在删除后执行nodetool flush可以防止提交日志中出现数据不兼容的问题?有没有办法修改CompositeType比较器而不执行drop / create?
答案 0 :(得分:0)
如果不执行drop / create,无法修改CompositeType比较器?删除后,您需要执行nodetool clearsnapshot。检查此链接 http://wiki.apache.org/cassandra/CassandraCli08