zoukankan      html  css  js  c++  java
  • Cassandra查询出错

    类似于如下情况:

    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. 

  • 相关阅读:
    理解k8s资源限制系列(二):cpu time
    计算机网络 第五章:传输层
    SYN 攻击原理及解决方法
    Lua中 pairs和ipairs的区别
    nginx里的变量,实现简单过滤。
    LVS负载均衡(LVS简介、三种工作模式、十种调度算法)
    Lua中的loadfile、dofile、require详解
    NGINX 上的限流
    shell 输出json格式的内容
    xilinx资源
  • 原文地址:https://www.cnblogs.com/xxdfly/p/5641613.html
Copyright © 2011-2022 走看看