无法实现一致性级别ONE:info = {'required_replicas':1,'alive_replicas':0,'consistency':1} [英] Cannot achieve consistency level ONE: info={ 'required_replicas': 1, 'alive_replicas': 0, 'consistency': 1}

查看:651
本文介绍了无法实现一致性级别ONE:info = {'required_replicas':1,'alive_replicas':0,'consistency':1}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来在我的Cassandra设置中没有正确地执行键空间复制,我需要一些想法来解决这个问题。我已经配置了多数据中心集群,但是开始我已经设置keyspace使用SimpleStrategy与RF 3.

It looks like keyspace replication is not happening correctly in my Cassandra setup, I need some ideas in troubleshooting this. I have configured multi datacenter cluster but to begin with I have set the keyspace to use SimpleStrategy with RF 3.

列族存在:

cqlsh:kairosdb> select columnfamily_name from system.schema_columnfamilies where keyspace_name = 'kairosdb';

 columnfamily_name
-------------------
       data_points
     row_key_index
      string_index

(3 rows)

但我无法查询:

cqlsh:kairosdb> select count(*) from data_points limit 100000;
 Traceback (most recent call last):
  File "/usr/bin/cqlsh", line 957, in perform_simple_statement
    rows = self.session.execute(statement, trace=self.tracing_enabled)
  File "/usr/share/cassandra/lib/cassandra-driver-internal-only-2.1.1.post.zip/cassandra-driver-2.1.1.post/cassandra/cluster.py", line 1282, in execute
    result = future.result(timeout)
  File "/usr/share/cassandra/lib/cassandra-driver-internal-only-2.1.1.post.zip/cassandra-driver-2.1.1.post/cassandra/cluster.py", line 2776, in result
    raise self._final_exception
Unavailable: code=1000 [Unavailable exception] message="Cannot achieve consistency level ONE" info={'required_replicas': 1, 'alive_replicas': 0, 'consistency': 1}


  1. 在种子列表中使用每个DC中的2个节点

  2. 对Snitch使用org.apache.cassandra.locator.GossipingPropertyFileSnitch

  3. 在cassandra-rackdc.properties中为节点指定不同的名称

以下是创建的键空间:

cqlsh:kairosdb> describe keyspace kairosdb;

CREATE KEYSPACE kairosdb WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'}  AND durable_writes = true;

任何想法我可以做什么来解决这个问题?

Any ideas what I can do to troubleshoot this?

推荐答案

在您的键空间创建中,您有以下语法:

In your keyspace creation you have this syntax:

CREATE KEYSPACE kairosdb WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'}  AND durable_writes = true;

NetworkTopologyStrategy ,例如:

CREATE KEYSPACE kairosdb WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': 3, 'DC2': 3};

按照以下文档链接使用 NetworkTopologyStrategy 当您拥有(或计划拥有)跨多个数据中心部署的群集...

As per the following documentation link, "Use NetworkTopologyStrategy when you have (or plan to have) your cluster deployed across multiple data centers..."

http://www.datastax.com/documentation/cassandra/2.0/cassandra/architecture/architectureDataDistributeReplication_c.html

这篇关于无法实现一致性级别ONE:info = {'required_replicas':1,'alive_replicas':0,'consistency':1}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆