在Cassandra上创建密钥空间

时间:2017-11-28 09:04:38

标签: cassandra

我是Cassandra的新手,我wrote a blog in French that narrate all the unpleasant experiences that I have because of him(就像重新启动后启动它时总是有Unable to find java executable或7199一直在使用...)。我创建了一个github存储库来共享我的cassandra目录。

但是到现在为止,我可以管理它们,这是我上次试图推出Cassandra时没有出现的新版本。

我尝试在tutorialspoint教程的帮助下创建一个关于Cassandra的键空间,但是有一个问题:当我创建一个Keyspace的命令时:

;CREATE KEYSPACE k1 WITH
    strategy_class = 'SimpleStrategy'
    AND trategy_otpions:replication_factor = '1';
    ...

甚至:

cqlsh> CREATE KEYSPACE k1 WITH
   ... replication = {'class': 'strategy_class = 'SimpleStrategy'
   ... AND trategy_otpions:replication_factor = '1';
   ... 

即使在分号后也只是编译了......

你有什么想法吗?

你对Cassandra有一个很好的教程吗?

编辑28/11

我不知道为什么但这个命令有效:

cqlsh> CREATE KEYSPACE IF NOT EXISTS k1 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;

我的下一个问题将是如何导入a very large csv file one can found on the open platform of French public data至少有150列可以都有vartext类型,但第一列是数字。

1 个答案:

答案 0 :(得分:1)

我认为你的cqlsh语法是错误的,如果你粘贴的那个是你使用过的那个。

cqlsh的正确语法是CREATE KEYSPACE test WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 3};

要从csv文件导入数据,您应该阅读https://docs.datastax.com/en/cql/3.3/cql/cql_using/useInsertCopyCSV.html