cluster 的结构如下:
keyspace :{replication_factor:1, class:SimpleStrategy}
[root@edog1 apache-cassandra-2.0.9]# bin/nodetool status
Note: Ownership information does not include topology; for complete information, specify a keyspace
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns Host ID Rack
UN 192.168.1.245 1.98 TB 256 35.2% 3f5395be-b346-404e-8a72-cc6fda5716f8 rack1
UN 192.168.1.205 959.96 GB 256 31.1% b294b651-3403-4f6f-a253-b7c9c0f2caf5 rack1
UN 192.168.1.254 1.53 TB 256 33.7% 9adf54bc-8727-4463-a205-0a4cbcfa47da rack1
---------------------------------------------------------------------------------------------------------------------------
报错如下:
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'}
上面是select时报的错,
------------------------------------------------------------------------------------------------------------------------
原因:
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.
分享到:
相关推荐
Cassandra查询分析器
sigar替代文件
这是一个结合cassandra数据库安装文档,里面有在linux 和window xp下的安装步骤。cassandra是一个分布式数据库,现于大家共享。
这是一个简单的Eclipse项目,将显示如何将使用Datastax的Java驱动程序进行的Cassandra查询转换为Json格式。 这对于进行某种导入或ETL很有用。 基本上,查询Cassandra并以Json格式返回结果。 入门 对于此示例,我有...
Cassandra是一个混合型的非关系的...你不必重启任何进程,改变应用查询,或手动迁移任何数据。 多数据中心识别 :你可以调整你的节点布局来避免某一个数据中心起火,一个备用的数据中心将至少有每条记录的完全复制。
cassandra 实战cassandra 实战cassandra 实战cassandra 实战cassandra 实战cassandra 实战cassandra 实战cassandra 实战cassandra 实战cassandra 实战cassandra 实战cassandra 实战cassandra 实战cassandra 实战...
Cassandra(apache-cassandra-3.11.11-bin.tar.gz)是一套开源分布式NoSQL数据库系统。它最初由Facebook开发,用于储存收件箱等简单格式数据,集GoogleBigTable的数据模型与Amazon Dynamo的完全分布式的架构于一身...
DevCenter cassandra客户端 DevCenter cassandra客户端 DevCenter cassandra客户端
Cassandra(apache-cassandra-4.0.1-bin.tar.gz)是一套开源分布式NoSQL数据库系统。它最初由Facebook开发,用于储存收件箱等简单格式数据,集GoogleBigTable的数据模型与Amazon Dynamo的完全分布式的架构于一身...
The rising popularity of Apache Cassandra rests on its ability to handle very large data sets that include hundreds of terabytes -- and that's why this distributed database has been chosen by ...
这是设计用于在Elasticsearch中归档查询日志的概念证明。 按照相同的原则,可以将日志存储在任何其他数据存储中(Cassandra,Mysql,Postgress)(欢迎使用PR)。卡桑德拉版本此代码已在Cassandra 3.0.16上进行了...
Cassandra的主要特点就是它不是一个数据库,而是由一堆数据库节点共同构成的一个分布式网络服务,对Cassandra 的一个写操作,会被复制到其他节点上去,对Cassandra的读操作,也会被路由到某个节点上面去读取。...
Title: Mastering Apache Cassandra, 2nd Edition Author: Nishant Neeraj Length: 322 pages Edition: 2 Language: English Publisher: Packt Publishing Publication Date: 2015-02-27 ISBN-10: 1784392618 ISBN-...
spring boot与cassandra集成,使用JPA方式。
1、cassandra的安装、维护使用 2、java操作cassandra实例 3、cql使用详解
Laravel开发-cassandra Laravel的Cassandra雄辩模型和查询生成器
See how to get 100 percent uptime with your Cassandra applications using this easy-follow guide Learn how to avoid common and not-so-common mistakes while working with Cassandra using this highly ...
编程方式设置Cassandra,主要包含以下5个包,W3C认证 slf4j-api-1.7.5.jar cassandra-driver-core-2.0.2.jar guava-16.0.1.jar metrics-core-3.0.2.jar netty-3.9.0.Final.jar