简体   繁体   English

Cassandra一致性级别问题

[英]Cassandra Consistency level issue

We have 3 Node Cassandra cluster with replication of 3 . 我们有3个节点Cassandra集群,其中有3个副本。 some time back Cassandra (1 Node) is down for 2 days. 一段时间后,Cassandra(1个节点)关闭了2天。

Now We are Unable to Read data from Cassandra cluster 现在我们无法从Cassandra集群读取数据

some time we are getting not frequently 一段时间我们不经常去

Caused by: com.datastax.driver.core.exceptions.ReadFailureException: Cassandra failure during read query at consistency ONE (1 responses were required but only 0 replica responded, 1 failed) at com.datastax.driver.core.exceptions.ReadFailureException.copy(ReadFailureException.java:95) at com.datastax.driver.core.Responses$Error.asException(Responses.java:128) at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179) at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184) at com.datastax.driver.core.RequestHandler.access$2500(RequestHandler.java:43) at com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:798) 由以下原因引起: com.datastax.driver.core.exceptions.ReadFailureExceptioncom.datastax.driver.core.exceptions.ReadFailureException处一致性为ONE(要求1个响应,但仅响应0个副本,失败1个)的读查询期间,Cassandra失败 。在com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)处com.datastax.driver.core.Responses $ Error.asException(Responses.java:128)处复制(ReadFailureException.java:95) .datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:184)位于com.datastax.driver.core.RequestHandler.access $ 2500(RequestHandler.java:43)位于com.datastax.driver.core.RequestHandler $ SpeculativeExecution。 setFinalResult(RequestHandler.java:798)

We have fired node >nodetool repair 我们已触发节点> nodetool修复

How we check whether all data replicated all node ? 我们如何检查所有数据是否复制了所有节点? What should be consistency level for read/write? 读/写的一致性级别应该是多少? .Currently consistency level is default(One). 当前一致性级别为default(One)。

Is there any schema level changes required. 是否需要任何架构级别的更改。

Any Administration Comment required? 需要任何管理意见吗?

What I think is to set the write consistency to all. 我认为是为所有人设置写一致性。 In this way all the nodes will acknowledge that they received the write request and set the read to one and in this way you the coordinator node will always be responding with the most recent data. 这样,所有节点都将确认它们已收到写入请求,并将读取设置为1,这样协调器节点将始终以最新数据进行响应。 As you mentioned about Node tool repair it's a good practice to have it handy specially in case of node failure. 正如您提到的有关Node工具修复的一个好习惯,特别是在出现节点故障的情况下,方便使用它是一种好习惯。

Other than that I would recommend you to check the logs because this is a failure and you may find something on there. 除此之外,我建议您检查日志,因为这是失败的,您可能会在其中找到某些东西。

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

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