Cassandra 插入错误
我有一个 4 节点 Cassandra 集群,其中有 2 个 Cassandra 节点和 2 个 brisk 节点[cassandra+TT]。 Brisk beta 2
我使用 cassandra-cli 插入创建和更新列族
我的插入和投影总是失败。例如
计数器列族
[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
标准列族
[default@StatsKeySpace] set TestColumnFamily['Test']['tamil']='hai';
null
所有节点在集群中都处于活动状态
这是我的键空间定义
Keyspace: StatsKeySpace:
Replication Strategy: org.apache.cassandra.locator.NetworkTopologyStrategy
Durable Writes: true
Options: [replication_factor:1]
我在调试模式下尝试了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)
两个列族都有replicate_on_write false 感谢您提前的帮助
问候, 泰米尔语
I have a 4 Node Cassandra cluster with 2 Cassandra nodes and 2 brisk nodes[cassandra+TT]. Brisk beta 2
I used cassandra-cli to insert create and update column families
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
[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
Regards,
Tamil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢杰贝利斯,
我升级了 brisk 附带的 cassandra 版本,并设置了调试模式运行 cassandra-cli。正如 jbellis 提到的,我得到了一个有意义的例外。
UnavailableException - 没有足够的活动节点来满足复制因子。
由于 brisk 使用 brisksnitch,它跨不同的 DC 部署 brisk 节点和 cassandra 节点。我的 4 节点集群之一(Brisk DC 的种子)已关闭。我希望这就是我得到这个例外的原因。
因此,我重新启动了整个集群,所有节点都升级为 0.8.6,并且密钥空间采用最简单的策略,因为我的部署只需要一个数据中心。
现在我所有的插入和投影都做得很好:) 希望 brisk b2 在各个方面都与 0.8.6 兼容
问候,
泰米尔语
Thanks to jbellis,
I upgraded the cassandra version being shipped with brisk and ran cassandra-cli with debug mode set. As jbellis mentioned I got a meaningful exception.
UnavailableException - Not enough nodes alive for replication factor to be satisfied.
Since brisk uses brisksnitch which deploys brisk nodes and cassandra nodes across different DCs. One of my 4 nodes cluster which is the seed for Brisk DC was down. 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.
Now all my insertions and projections are doing fine :) Hope brisk b2 is compatible with 0.8.6 in all aspects
Regards,
Tamil.s
您正在尝试增加非计数器列。请参阅 http://www. datastax.com/dev/blog/whats-new-in-cassandra-0-8-part-2-counters 查看创建与计数器一起使用的 CF 的示例。
(Brisk b2 附带了目前相当旧的 Cassandra 版本。我相信较新的版本会返回更有用的错误消息。)
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.
(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.)