【问题标题】:Cassandra and cqlsh - "Cassandra unknown" and "CQL spec unknown"Cassandra 和 cqlsh -“Cassandra 未知”和“CQL 规范未知”
【发布时间】:2014-09-30 01:06:05
【问题描述】:

我刚刚在 Ubuntu 上下载了 Cassandra 1.0.10 和 Java 1.6.0_45。当我在终端上运行命令 cqlsh 时,我得到以下输出:

Connected to Test Cluster at localhost:9160. 
[cqlsh 2.0.0 | Cassandra unknown | CQL spec unknown | Thrift protocol 19.20.0]
Use HELP for help.

有人可以向我解释为什么它说“Cassandra 未知”和“CQL 规范未知”吗?我也无法获取命令

 DESC KEYSPACES;

工作-它只是说

Improper desc command.

有人可以告诉我这里的问题是什么吗?我意识到我使用的是旧版本的 Cassandra - 这可能是原因吗?

编辑:我意识到上述方法不起作用,因为我使用了错误的语法。它应该是 DESC KEYSPACES ;这样就可以解决那个问题了。

【问题讨论】:

  • 我强烈建议升级到 2.0.9。我对这个问题的唯一猜测是你的 cqlsh 版本和 c* 版本不匹配。
  • 我同意@Ru​​ssS - 如果您使用的是当前版本,您将获得所有最新功能和修复,并且更有可能找到可以提供帮助的人。 cassandra.apache.org/download
  • @RussS 感谢您的建议,但是我工作的地方专门使用了旧版本的 cassandra,我需要用 java 编写一个可以使用它的脚本。因此,我至少需要使用 Cassandra 1.0。

标签: linux ubuntu cassandra cql cqlsh


【解决方案1】:

我也无法获取命令

   DESC KEYSPACES;

工作-它只是说

   Improper desc command.

这是因为 DESC KEYSPACES 不是 Cassandra 1.0.x 附带的 cqlsh 版本中的有效命令。这是source from that version。只需跳到def do_describe(self, parsed):,您就会发现它不在其中。更好的是,在cqlsh 中,您可以通过运行help desc 来验证这一点。 DESC KEYSPACE [<keyspacename>] 是,但 DESC KEYSPACES 不是。

同样,您看到这个| Cassandra unknown | CQL spec unknown | 也是出于同样的原因。该版本的cqlsh 尝试使用system.Versions 列族来查看您正在运行的软件版本。但是旧版本的 1.0.x 一定没有那个列族。在上面的同一个链接中,跳到def get_cluster_versions(self):,你会找到负责的代码:

def get_cluster_versions(self):
    try:
        self.cursor.execute('select component, version from system.Versions')
        vers = dict(self.cursor)
    except cql.ProgrammingError:
        # older Cassandra; doesn't have system.Versions
        thrift_ver = self.get_thrift_version()
        return {'build': 'unknown', 'cql': 'unknown', 'thrift': thrift_ver}
    return vers

基本上,您的问题是由于您使用的是 Cassandra 版本的TRS-80。并且从那时起使用了 Cassandra 的版本,我可以告诉你,你的问题不会变得更好。除了您缺少的 2.0.x 的所有重要功能之外,该版本还存在早已消除的错误。尽管您的公司可能不想要这样做,但他们拒绝升级只会招致更多潜在问题。

【讨论】:

    猜你喜欢
    • 2013-11-16
    • 2017-04-30
    • 2015-10-08
    • 2020-10-05
    • 2020-10-03
    • 2011-01-24
    • 2017-09-20
    • 2015-03-10
    • 1970-01-01
    相关资源
    最近更新 更多