如何解决ALTER TABLE后的模式不匹配问题?

时间:2015-05-07 11:47:17

标签: cassandra cassandra-2.0

我在cqlsh中运行此命令(在运行Cassandra 2.1.2的10节点生产群集中):

cqlsh:aisdata> alter table packets_area_cell10 with compression = { 'sstable_compression' : 'DeflateCompressor', 'chunk_length_kb' : 1024 };
errors={}, last_host=127.0.0.1

' alter table'尽管超时,命令似乎已经运行。

但随后cqlsh遇到了(https://issues.apache.org/jira/browse/CASSANDRA-8512) - 并且在应用了CASSANDRA-8512中提到的补丁之前几乎无法使用。

那么,他们如何解决Cassandra中的模式不匹配问题;所以,例如cqlsh可以再次运行吗?

更新1

cqlsh> select release_version, host_id, schema_version from system.local;

 release_version | host_id                              | schema_version
-----------------+--------------------------------------+--------------------------------------
           2.1.2 | 15bb29cd-1c3c-43c9-ac82-e27d0b236066 | 489c8f81-4346-3bbe-afb9-bd998302d3a3

(1 rows)
cqlsh> select peer, release_version, host_id, schema_version from system.peers;

 peer        | release_version | host_id                              | schema_version
-------------+-----------------+--------------------------------------+--------------------------------------
 10.51.78.29 |           2.1.2 | de10ceb6-3fc1-4739-9d40-66a5ac510eeb | 22e8d11f-4c62-362f-8706-bf694c1a95dd
 10.51.78.27 |           2.1.2 | 6b165d96-5425-4e24-9e9d-d59bfab729fd | 489c8f81-4346-3bbe-afb9-bd998302d3a3
 10.51.78.20 |           2.1.2 | 6114a6bf-e3cf-4bce-b423-5d2c3976afc8 | 489c8f81-4346-3bbe-afb9-bd998302d3a3
 10.51.78.57 |           2.1.2 | 59ed0b67-6c45-48de-8755-ad8c7770f0ff | 489c8f81-4346-3bbe-afb9-bd998302d3a3
 10.51.78.59 |           2.1.2 | 00254eef-7b21-4f3a-9c18-159d4c1d4d73 | 489c8f81-4346-3bbe-afb9-bd998302d3a3
 10.51.78.58 |           2.1.2 | 90ccccdf-22b5-4eb3-99a6-5b880c5f5ebf | 489c8f81-4346-3bbe-afb9-bd998302d3a3
 10.51.78.14 |           2.1.2 | 60393d6d-fcb8-42ec-ba40-e34ec8d4ec69 | 489c8f81-4346-3bbe-afb9-bd998302d3a3
 10.51.78.56 |           2.1.2 | 5b82e847-7c8c-4b22-bc54-2fece674c8fa | 489c8f81-4346-3bbe-afb9-bd998302d3a3
 10.51.78.26 |           2.1.2 | a4d2d02b-74e6-4ab1-b610-efdf58f7c918 | 489c8f81-4346-3bbe-afb9-bd998302d3a3

1 个答案:

答案 0 :(得分:3)

通过运行:

从system.peers中删除ghost节点来解决
delete from system.peers where peer='10.51.78.29';

在所有节点上。