0

总 Cassandra 新手在这里,使用 Python 客户端。

from cassandra.cluster import Cluster
cluster = Cluster(['127.0.0.1'])
session = cluster.connect()

我得到错误:

线程 event_loop 中的异常(很可能在解释器关闭期间引发):
回溯(最后一次调用):
文件“/usr/lib/python2.7/threading.py”,第 551 行,在__bootstrap_inner
文件“/usr/lib/python2. 7/threading.py”,第 504 行,在运行
文件“/usr/local/lib/python2.7/dist-packages/cassandra_driver-1.0.2-py2.7-linux-x86_64.egg/cassandra/io/asyncorereactor .py”,第 52 行,在 _run_loop 中
__exit__

我想创建我的第一个表并且无法通过会话。

query = "create table timeseries (
  event_type text,
  insertion_time timestamp,
  event blob,
  PRIMARY KEY (event_type, insertion_time)
)
WITH CLUSTERING ORDER BY (insertion_time DESC);"

session.execute(query)
4

0 回答 0