Olz*_*bay 11 python cql cassandra cql3
我正在尝试使用这个简单的代码连接到cassandra,它运行在本地桌面上,通过cassandra-driver for python.
from cassandra.cluster import Cluster
cluster = Cluster()
session = cluster.connect()
Run Code Online (Sandbox Code Playgroud)
并收到此错误:NoHostAvailable:('无法连接到任何服务器',{'127.0.0.1':InvalidRequest(u'code = 2200 [无效查询] 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
Run Code Online (Sandbox Code Playgroud)
任何有关未配置表解决此问题的帮助将不胜感激.
您是否可以使用驱动程序连接到Cassandra 3.0.0-alpha1?如果是这样,您需要运行从此提交安装的驱动程序:
https://github.com/datastax/python-driver/tree/1a480f196ade42798596f5257d2cbeffcadf154f
或者:
DataStax正在准备一个3.0.0a1版本的驱动程序,用于Cassandra 3.0.0-alpha1,很快就会在pypi中使用.
安装3.0.0 alpha版本的驱动程序如下:
pip install --pre cassandra-driver
pip install --pre --upgrade cassandra-driver