【问题标题】:Error: unable to connect to cassandra server. Unconfigured table错误:无法连接到 cassandra 服务器。未配置的表
【发布时间】:2015-10-27 18:12:27
【问题描述】:

我正在尝试使用这个简单的代码通过 cassandra-driver for python 连接到在本地桌面上运行的 cassandra。

 from cassandra.cluster import Cluster
 cluster = Cluster()
 session = cluster.connect()

并收到此错误:NoHostAvailable: ('Unable to connect to any servers', {'127.0.0.1': InvalidRequest(u'code=2200 [Invalid query] message="unconfigured table schema_keyspaces "',)})

从 cassandra 的日志中,我看到它是如何建立连接的,但它得到了这个错误:

DEBUG 05:51:00 Responding: ERROR INVALID: unconfigured table schema_columnfamilies, v=4
DEBUG 05:51:00 Responding: ERROR INVALID: unconfigured table schema_usertypes, v=4
DEBUG 05:51:00 Responding: ERROR INVALID: unconfigured table schema_columns, v=4
DEBUG 05:51:00 Responding: ERROR INVALID: unconfigured table schema_functions, v=4
DEBUG 05:51:00 Responding: ERROR INVALID: unconfigured table schema_aggregates, v=4
DEBUG 05:51:00 Responding: ERROR INVALID: unconfigured table schema_triggers, v=4

任何帮助解决未配置表的问题将不胜感激。

【问题讨论】:

    标签: python cassandra cql cql3


    【解决方案1】:

    您是否可能使用驱动程序连接到 Cassandra 3.0.0-alpha1?如果是这样,您需要运行从该提交安装的驱动程序:

    https://github.com/datastax/python-driver/tree/1a480f196ade42798596f5257d2cbeffcadf154f

    或者:

    • 如果您只是在进行试验,那么今天发布的驱动程序适用于所有 Cassandra 版本 1.2 - 2.2.0
    • DataStax 正在准备与 Cassandra 3.0.0-alpha1 一起使用的 3.0.0a1 版本的驱动程序,该驱动程序将很快在 pypi 中可用。

    • 安装3.0.0 alpha版驱动如下:

      pip install --pre cassandra-driver

      pip install --pre --upgrade cassandra-driver

    【讨论】:

    • 谢谢!我降级了 cassandra。
    • 不错,也适合我。也许你需要安装软件包 libev4 libev-dev 来支持 libev。
    【解决方案2】:

    当我收到相同的错误消息并搜索信息时,出现了此线程,但给出的答案对我没有帮助。我最终发现了这个问题。我运行的是 Cassandra 3.6,目前可用的 cassandra-driver 是 3.4.1 版本。

    但是,由于某种原因,我安装了 2.2.0 版的 cassandra-driver。我知道表 schema_keyspaces 在以后的版本中已被重命名/移动,这解释了为什么旧驱动程序没有得到预期的结果并退出。

    【讨论】:

      猜你喜欢
      • 2016-03-02
      • 2019-10-08
      • 2012-07-24
      • 2018-10-23
      • 2018-08-10
      • 2019-06-28
      • 2020-10-19
      • 2018-05-27
      • 2013-03-25
      相关资源
      最近更新 更多