2013-07-11 51 views
2

關於tombstone compaction我怎麼能生產出「墓碑壓實」在卡桑德拉1.2.6

我想知道爲什麼我不能在cassandra1.2.6產生「墓碑壓實」。

[步驟]

  1. 在卡桑德拉-CLI

    create keyspace keyspace1 with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options = {replication_factor:3};

    use keyspace1;

    create column family cf1 with comparator=AsciiType and default_validation_class=AsciiType and key_validation_class=AsciiType and compaction_strategy_options={tombstone_compaction_interval: 1, tombstone_threshold: '0.1'} and gc_grace=600 and column_metadata=[ {column_name: column1, validation_class: LongType} ];

  2. 條目創建列家族的一些數據與在cassan TTL DRA-CLI如下

    set cf1['key1']['column1']=100 with ttl = 1;
    set cf1['key2']['column1']=200 with ttl = 1;
    set cf1['key3']['column1']=300 with ttl = 1;
    set cf1['key4']['column1']=400 with ttl = 600;
    set cf1['key5']['column1']=500 with ttl = 600;
    set cf1['key6']['column1']=600 with ttl = 600;

  3. 執行 'nodetool沖洗'

  4. 檢查Data.db與sstable2json

    {"key": "2412441","columns": [["column1","100",1373516242953000,"d"]]},
    {"key": "2412442","columns": [["column1","200",1373516242963000,"d"]]},
    {"key": "2412443","columns": [["column1","300",1373516242973000,"d"]]},
    {"key": "2412444","columns": [["column1","400",1373516242983000,"e",600,1373516300]]},
    {"key": "2412445","columns": [["column1","500",1373516242983000,"e",600,1373516300]]},
    {"key": "2412446","columns": [["column1","600",1373516242983000,"e",600,1373516300]]}

  5. 等待超過1小時....它具有Data.db沒有變化....沒有生成墓碑壓實...

  6. 輸入一些數據,並執行nodetool再次刷新......只是新Data.db創建......沒有產生墓碑壓實......

我想只是嘗試「墓碑壓實」 。

回答

2

您可能沒有足夠的數據在Cassandra的sstable中猜測墓碑比例。您可以通過JMX的ColumnFamilyStoreMBean中的getDroppableTombstoneRatio方法來檢查。

+0

我試圖使用一些GB數據。但沒有生產墓碑壓實... DroppableTombstoneRatio是0.5336280444019503。 什麼是墓碑壓實的觸發器? – user2572068

+0

男人,你有沒有在這種情況下更新? – odiszapc

+0

tombstone_threshold是一個壓縮策略選項,默認爲0.2,即如果sstable超過20%墓碑,將被視爲邏輯刪除壓縮。只有在沒有其他壓縮排隊時才執行墓碑壓縮。 – jbellis