首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Cassandra 3.11.0中导入模式

在Cassandra 3.11.0中导入模式
EN

Stack Overflow用户
提问于 2017-08-07 07:59:50
回答 1查看 532关注 0票数 1

Cassandra模式,

代码语言:javascript
复制
use testscheduler;
create columnfamily TaskSchedule
with column_type = 'Standard'


and comparator = 'CompositeType(DateType,UTF8Type,UTF8Type)'
  and default_validation_class = 'UTF8Type'
  and key_validation_class = 'CompositeType(Int32Type,UTF8Type)'
  and read_repair_chance = 0.2
  and dclocal_read_repair_chance = 0.0
  and populate_io_cache_on_flush = false
  and gc_grace = 43200
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = true
  and compaction_strategy = 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'
  and caching = 'KEYS_ONLY'
  and compression_options = null;

我试过用"Keyspace schema import and export in Cassandra“这个例子,我现在的cassandra版本不支持”cassandra“命令。如何将上面提到的模式导入cassandra-3.11.0。谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-07 08:56:40

不建议使用cassandra-cli,而是使用cqlsh (您的代码片段也使用CQL (cassandra ),它需要cqlsh)。在尝试创建表之前,可以先创建密钥空间。

代码语言:javascript
复制
CREATE KEYSPACE testscheduler WITH replication = {'class':'SimpleStrategy',
   'replication_factor' : 1};

有一些很好的教程,例如https://www.tutorialspoint.com/cassandra/https://academy.datastax.com/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45542002

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档