简体   繁体   English

卡桑德拉插入错误

[英]Cassandra Insertion Error

I have a 4 Node Cassandra cluster with 2 Cassandra nodes and 2 brisk nodes[cassandra+TT]. 我有一个4节点Cassandra集群,有2个Cassandra节点和2个快节点[cassandra + TT]。 Brisk beta 2 轻快的beta 2

I used cassandra-cli to insert create and update column families 我使用cassandra-cli插入创建和更新列族

My insertions and projections are are always getting failed. 我的插入和投射总是失败。 For example 例如

Counter Column family 计数器列族

[default@StatsKeySpace] create column family Impressions with comparator=UTF8Type and default_validation_class=CounterColumnType and key_validation_class=UTF8Type;
175d69d0-eb6f-11e0-0000-93bbb4d362fc
Waiting for schema agreement...
... schemas agree across the cluster
[default@StatsKeySpace] incr Impressions['Test']['impressions'] by 10;
null
[default@StatsKeySpace] incr Impressions['Test']['impressions'] by 1; 
null
[default@StatsKeySpace] get Impressions['Test']['impressions'];
null
[default@StatsKeySpace] list Impressions;
Using default limit of 100
null

Standard Column family 标准列族

[default@StatsKeySpace] set TestColumnFamily['Test']['tamil']='hai';
null

All the nodes are alive in the cluster 群集中的所有节点都处于活动状态

This is my keyspace defn 这是我的密钥空间定义

Keyspace: StatsKeySpace:
  Replication Strategy: org.apache.cassandra.locator.NetworkTopologyStrategy
  Durable Writes: true
    Options: [replication_factor:1]

I tried cassandra-cli with debug mode I found this error 我用调试模式尝试了cassandra-cli我发现了这个错误

[default@unknown] use StatsKeySpace;
Authenticated to keyspace: StatsKeySpace
[default@StatsKeySpace] incr Impressions['tamil']['count'] by 1;
null
java.lang.RuntimeException
    at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:297)
    at org.apache.cassandra.cli.CliMain.processStatement(CliMain.java:217)
    at org.apache.cassandra.cli.CliMain.main(CliMain.java:345)

Both the column families has replicate_on_write false Thanks for help in advance 两个列系列都有replicate_on_write false感谢提前帮助

Regards, Tamil 此致,泰米尔语

Thanks to jbellis, I upgraded the cassandra version being shipped with brisk and ran cassandra-cli with debug mode set. 感谢jbellis,我升级了带有brisk的cassandra版本并运行了调试模式设置的cassandra-cli。 As jbellis mentioned I got a meaningful exception. 正如jbellis所说,我得到了一个有意义的例外。

UnavailableException - Not enough nodes alive for replication factor to be satisfied. UnavailableException - 没有足够的节点存活以满足复制因子。

Since brisk uses brisksnitch which deploys brisk nodes and cassandra nodes across different DCs. 由于轻快使用brisksnitch,它在不同的DC上部署轻快的节点和cassandra节点。 One of my 4 nodes cluster which is the seed for Brisk DC was down. 我的4个节点集群中有一个是Brisk DC的种子。 I hope that is why I was getting that exception. 我希望这就是为什么我得到那个例外。

So, I restarted my entire cluster with all nodes upgraded with 0.8.6 and keyspace with simplestrategy since, my deployment need to have only one datacenter. 因此,我重新启动了整个集群,所有节点都升级了0.8.6,密钥空间使用simplestrategy,因为我的部署只需要一个数据中心。

Now all my insertions and projections are doing fine :) Hope brisk b2 is compatible with 0.8.6 in all aspects 现在我所有的插入和预测都很好:)希望brisk b2在所有方面都兼容0.8.6

Regards, Tamil.s 此致,泰米尔语

You are trying to increment non-counter columns. 您正在尝试增加非计数器列。 See http://www.datastax.com/dev/blog/whats-new-in-cassandra-0-8-part-2-counters for an example of creating a CF for use with counters. 有关创建用于计数器的CF的示例,请参见http://www.datastax.com/dev/blog/whats-new-in-cassandra-0-8-part-2-counters

(Brisk b2 ships with what is at this point a fairly old version of Cassandra. I believe newer versions will give back a more helpful error message.) (Brisk b2附带的是Cassandra相当旧的版本。我相信较新的版本会返回更有用的错误信息。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM