Cassandra CQLSH显示错误的架构?

时间:2017-04-17 16:17:26

标签: cqlsh cassandra-2.1

我正在尝试将一些数据从一个Cassandra集群迁移到 另一个使用CQLSH的{​​{1}},但我遇到了一个奇怪的问题 其中一个列族。 COPY的架构,如下所述 cqslsh,看起来像这样:

foo.quux

但是,在查询此表/列时,它会响应:

CREATE TABLE foo.quux (
    key blob,
    column1 blob,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
    AND CLUSTERING ORDER BY (column1 ASC)
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.SnappyCompressor'}
    AND dclocal_read_repair_chance = 0.0
    AND default_time_to_live = 0
    AND gc_grace_seconds = 86400
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.1
    AND speculative_retry = '99.0PERCENTILE';

请注意,此输出的[cqlsh 5.0.1 | Cassandra 2.1.15 | CQL spec 3.2.1 | Native protocol v3] Use HELP for help. cqlsh> select * from foo.quux limit 3; key | column1 | column2 | value ----------------------------------------------------------------------+--------------------------+---------+------------------------ 0x443635316337656439326336373436363661623363373833616131626364623762 | 0x31e2988335373035393739 | 0x61 | 0x54727565 0x443635316337656439326336373436363661623363373833616131626364623762 | 0x31e2988335373035393739 | 0x63 | 0x31343739393832343931 0x443635316337656439326336373436363661623363373833616131626364623762 | 0x31e2988335373035393739 | 0x6c72 | 0x4e6f6e65 (3 rows) 不会在。{1}}中重复出现 架构!我想知道这是否与column2有关 根据{{​​1}},这是一个超级列(这也不是 据我所知,在QCLSH架构输出中表示:

foo.quux

所以,我怀疑问题是cqslsh显示错误 架构,由于某种原因,并且column2在某种程度上缺失 架构。任何帮助找出如何从中恢复将是 非常欢迎。

最初可能有助于了解这个集群(好吧,在 差不多2年我来过这里)运行1.2版,但升级到了 几个月前2.0和2.1。我们没有发现任何坏事 这次升级的效果。

另外,我对Cassandra的经验很少,所以如果你的话 想“这听起来像 X ,但他们必须想到这一点 已经“然后建议它 - 因为我很可能没有 想到这一点。

1 个答案:

答案 0 :(得分:1)

神秘解决了吗?我尝试用不同的方式连接到群集 cqlsh程序(直接来自我的Mac),但现在报告了集群 不支持3.3.1的CQLVersion,我不得不使用3.2.1 代替。现在我从DESCRIBE获得了不同的结果:

cqlsh --cqlversion 3.2.1 52.206.209.178 -e 'DESCRIBE foo.quux;'

/*
Warning: Table foo.quux omitted because it has constructs not compatible with CQL (was created via legacy API).

Approximate structure, for reference:
(this should not be used to reproduce this schema)

CREATE TABLE foo.quux (
    key blob,
    column1 blob,
    value blob,
    column2 blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
    AND CLUSTERING ORDER BY (column1 ASC)
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND dclocal_read_repair_chance = 0.0
    AND default_time_to_live = 0
    AND gc_grace_seconds = 86400
    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 = 'NONE';
*/

看起来架构是通过Thrift创建的,但不可能  使用CQL正确表示。