2016-09-20 9 views
2

내 테이블에 노드 20에서 CQLSH의 TRUNCATE 명령을 사용했습니다.왜 TRUNCATE 후에도 nodetool status * keyspace *에 수백 MB의 데이터가 표시됩니까?

명령을 실행 한 후 20 분이 지났으며 nodetool status *myKeyspace*의 결과는 여전히 6 개 노드 중 4 개에 많은 데이터를 보여줍니다. 나는 카산드라 3.0.8

192.168.178.20:/usr/share/cassandra$ nodetool status *myKeyspace* 
Datacenter: dc1 
=============== 
Status=Up/Down 
|/ State=Normal/Leaving/Joining/Moving 
-- Address   Load  Tokens  Owns (effective) Host ID        Rack 
UN 192.168.178.24 324,57 MB 256   32,7%    4d852aea-65c7-42e1-b2bd-f38a320ec827 rack1 
UN 192.168.178.28 650,86 KB 256   35,7%    82b67dc5-9f4f-47e9-81d7-a93f28a3e9da rack1 
UN 192.168.178.30 155,68 MB 256   31,9%    28cf5138-7b61-42ca-8b0c-e4be1b5418ba rack1 
UN 192.168.178.32 321,62 MB 256   33,3%    64e106ed-770f-4654-936d-db5b80aa37dc rack1 
UN 192.168.178.36 640,91 KB 256   33,0%    76152b07-caa6-4214-8239-e8a51bbc4b62 rack1 
UN 192.168.178.20 103,07 MB 256   33,3%    539a6333-c4ef-487a-b1e4-aac40949af4c rack1 

사용하고

다음 명령은 0.24 노드에서 실행되었다. 아직 스냅 샷/백업이 어딘가에 저장되어있는 것처럼 보입니까? 그러나 노드 .24에 대한 658MB의 데이터 양은보고 된 324MB (nodetool status)와 일치하지 않습니다. 거기 무슨 일 이죠?

192.168.178.24:/usr/share/cassandra$ nodetool cfstats *myKeyspace* 
Keyspace: *myKeyspace* 
     Read Count: 0 
     Read Latency: NaN ms. 
     Write Count: 0 
     Write Latency: NaN ms. 
     Pending Flushes: 0 
       Table: data 
       SSTable count: 0 
       Space used (live): 0 
       Space used (total): 0 
       Space used by snapshots (total): 658570012 
       Off heap memory used (total): 0 
       SSTable Compression Ratio: 0.0 
       Number of keys (estimate): 0 
       Memtable cell count: 0 
       Memtable data size: 0 
       Memtable off heap memory used: 0 
       Memtable switch count: 0 
       Local read count: 0 
       Local read latency: NaN ms 
       Local write count: 0 
       Local write latency: NaN ms 
       Pending flushes: 0 
       Bloom filter false positives: 0 
       Bloom filter false ratio: 0,00000 
       Bloom filter space used: 0 
       Bloom filter off heap memory used: 0 
       Index summary off heap memory used: 0 
       Compression metadata off heap memory used: 0 
       Compacted partition minimum bytes: 0 
       Compacted partition maximum bytes: 0 
       Compacted partition mean bytes: 0 
       Average live cells per slice (last five minutes): 3.790273556231003 
       Maximum live cells per slice (last five minutes): 103 
       Average tombstones per slice (last five minutes): 1.0 
       Maximum tombstones per slice (last five minutes): 1 

키 공간에서 정리 한 테이블 이외의 테이블이 없다는 점에 유의하십시오. TRUNCATE을 사용할 때 지워지지 않는다면 cassandra-lucene-index의 색인 데이터가있을 수 있습니다.

답변

1

nodetool status의 키 공간 옵션은 실제로 소유권을 계산할 때 포함 할 복제 요소와 데이터 센터를 알기위한 것입니다. 로드는 실제로 하나의 키 스페이스가 아닌 모든 sstables에 대한 것입니다. 키 공간 옵션을 설정하면 IP 주소, 호스트 ID 및 토큰 수에 영향을받지 않습니다. status은 글로벌 수표 중 하나입니다.

Space used by snapshots에는 여전히 오래된 데이터가있을 것으로 예상됩니다. 자를 때 데이터를 스냅 샷합니다 (cassandra.yamlauto_snapshot을 false로 설정하여 비활성화 할 수 있음). 모든 스냅 샷을 지울 때 사용할 수있는 nodetool clearsnapshot <keyspace>

+0

자를 사용하면 모든 보조 인덱스 데이터가 삭제됩니까? – j9dy

+1

예, 자르면 일부는 색인 및보기를 삭제합니다. –