Cassandra的create_keystpace_simp出错

2024-05-14 07:09:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用cassandra通过kafka连接Meetup流媒体api。cqlengine看起来它以前是一个单独的项目,我使用的参考代码是在那个时候制作的。在

所以之前,cqlengine.management有{} 现在,cassandra.cqlengine.management有{}

我正在尝试创建键空间。在

create_keyspace_simple('meetup', 'SimpleStrategy', 1)

但是,我得到了这个错误。 警告:

/Users/a/anaconda/lib/python2.7/site-packages/cassandra/cqlengine/management.py:419: UserWarning: CQLENG_ALLOW_SCHEMA_MANAGEMENT environment variable is not set. Future versions of this package will require this variable to enable management functions.
warnings.warn(msg)

错误:

^{pr2}$

Tags: kafka项目代码api错误create空间this
1条回答
网友
1楼 · 发布于 2024-05-14 07:09:08

根据documentation的外观,create_keyspace_simple接受以下参数列表:

create_keyspace_simple(name, replication_factor, durable_writes=True)
  • name (str) - name of keyspace to create
  • replication_factor (int) - keyspace replication factor, used with SimpleStrategy
  • durable_writes (bool) - Write log is bypassed if set to False

基于这一点,我认为如果您删除“SimpleStrategy”参数,您的语句将起作用。由于您使用的是create_keyspace_simple,所以SimpleStrategy是隐含的,因此您不必指定它。在

^{pr2}$

相关问题 更多 >

    热门问题