【发布时间】:2016-12-17 21:49:39
【问题描述】:
Cassandra 让我非常头疼。昨天,一切都运行良好,然后我删除了一个表,运行了一个 CQLSSTableWriter,它以某种方式抛出了关于我的 Lucene index 的错误(因为不在类路径等上),现在,我在 cqlsh 中发出的每个命令都抛出了错误.
CREATE KEYSPACE IF NOT EXISTS mydata WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};
需要一段时间然后抛出:
Warning: schema version mismatch detected, which might be caused by DOWN nodes;
if this is not the case, check the schema versions of your nodes in system.local and system.peers.
OperationTimedOut: errors={}, last_host=XXX.XXX.XXX.20
之后我将创建一个新表,它也会抛出同样的错误。
cqlsh:mydata> create table test (id text PRIMARY KEY, id2 text);
Warning: schema version mismatch detected, which might be caused by DOWN nodes; if this is not the case, check the schema versions of your nodes in system.local and system.peers.
OperationTimedOut: errors={}, last_host=XXX.XXX.XXX.20
last_host 总是显示我运行 cqlsh 的主机的 ip。我也尝试过使用不同节点的相同命令。
键空间和表仍在创建中!该错误说明了架构版本不匹配,所以我确定并运行:
nodetool describecluster
它的输出显示我所有的节点都在同一个模式上。没有架构不匹配。我之前也发出过nodetool resetlocalschema,但没有任何运气。
当我继续往新创建的表中插入一些数据时,会出现以下错误。请注意,插入语句不会返回错误。
cqlsh:mydata> insert into test(id, id2) values('test1', 'test2');
cqlsh:mydata> select * from mydata.test ;
Traceback (most recent call last):
File "/usr/bin/cqlsh.py", line 1314, in perform_simple_statement
result = future.result()
File "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.0.0-6af642d.zip/cassandra-driver-3.0.0-6af642d/cassandra/cluster.py", line 3122, 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': 'ONE'}
请注意,我有一个数据中心和五个节点。我不打算在未来使用多个数据中心。 [cqlsh 5.0.1 |卡桑德拉 3.0.8 | CQL 规范 3.4.0 |原生协议 v4]
我也多次重启 Cassandra。 nodetool status 显示所有节点都已启动并正在运行。有没有人知道发生了什么?
【问题讨论】: