Cassandra模式,
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。谢谢。
发布于 2017-08-07 08:56:40
不建议使用cassandra-cli,而是使用cqlsh (您的代码片段也使用CQL (cassandra ),它需要cqlsh)。在尝试创建表之前,可以先创建密钥空间。
CREATE KEYSPACE testscheduler WITH replication = {'class':'SimpleStrategy',
'replication_factor' : 1};有一些很好的教程,例如https://www.tutorialspoint.com/cassandra/和https://academy.datastax.com/。
https://stackoverflow.com/questions/45542002
复制相似问题