Cassandra查询出错
2016-07-04 20:27
260 查看
类似于如下情况:
Traceback (most recent call last):
File "python_del_cassandra.py", line 21, in <module>
d_time = K_devdata.execute(" select dtime from devicestatus where did = '%s' and dtime > %s and dtime < %s order by dtime asc ;" % (devsid,start,end))
File "/usr/lib64/python2.6/site-packages/cassandra/cluster.py", line 1594, in execute
result = future.result(timeout)
File "/usr/lib64/python2.6/site-packages/cassandra/cluster.py", line 3296, in result
raise self._final_exception
cassandra.Unavailable: code=1000 [Unavailable exception] message="Cannot achieve consistency level ONE" info={'required_replicas': 1, 'alive_replicas': 0, 'consistency': 'ONE'}
repliction_factor=1,时,只要有一个节点DN(down)掉的话,就会报这样的错,如果把replication_factor 改为2以上的话就不会报这个错了。
replication_factor 即复制因子
To directly answer the question, replication factor (RF) controls the number of replicas of each data partition that exist in a cluster or data center (DC). In your case, you have 3 nodes and a RF of 1. That means that when a row is written to your cluster, that it is only stored on 1 node. This also means that your cluster cannot withstand the failure of a single node.
In contrast, consider a RF of 3 on a 3 node cluster. Such a cluster could withstand the failure of 1 or 2 nodes, and still be able to support queries for all of its data.
Traceback (most recent call last):
File "python_del_cassandra.py", line 21, in <module>
d_time = K_devdata.execute(" select dtime from devicestatus where did = '%s' and dtime > %s and dtime < %s order by dtime asc ;" % (devsid,start,end))
File "/usr/lib64/python2.6/site-packages/cassandra/cluster.py", line 1594, in execute
result = future.result(timeout)
File "/usr/lib64/python2.6/site-packages/cassandra/cluster.py", line 3296, in result
raise self._final_exception
cassandra.Unavailable: code=1000 [Unavailable exception] message="Cannot achieve consistency level ONE" info={'required_replicas': 1, 'alive_replicas': 0, 'consistency': 'ONE'}
repliction_factor=1,时,只要有一个节点DN(down)掉的话,就会报这样的错,如果把replication_factor 改为2以上的话就不会报这个错了。
replication_factor 即复制因子
To directly answer the question, replication factor (RF) controls the number of replicas of each data partition that exist in a cluster or data center (DC). In your case, you have 3 nodes and a RF of 1. That means that when a row is written to your cluster, that it is only stored on 1 node. This also means that your cluster cannot withstand the failure of a single node.
In contrast, consider a RF of 3 on a 3 node cluster. Such a cluster could withstand the failure of 1 or 2 nodes, and still be able to support queries for all of its data.
相关文章推荐
- eclipse adt 选择ndk目录时不识别,出现“Not a valid NDK directory”
- 【优化软件】对优化软件的一些理解
- W3AF FuzzableRequest 处理流程札记
- Construct vector (构建vector)
- paper 80 :目标检测的图像特征提取之(一)HOG特征
- php命名空间
- android sudio 打包资料汇总
- 基于物品的协同过滤算法:理论说明,代码实现及应用
- 雅克比矩阵的scala实现
- R下一些函数
- W3AF插件编写
- 【matlab】利用matlab编写启发式算法
- 【原】Maven解决jar冲突调试步骤:第三方组件引用不符合要求的javassit导致的相关异常
- 链表的Java实现
- 交叉编译知识解析(二) —— 交叉编译器的名字的命名规则
- RecyclerView通用适配器Adapter,对Adapter的封装
- 百度一道笔试题
- 秦晖:王小波是一个自由主义思想家吗?
- RTSP协议介绍
- php5中this关键字用法讲解