2016-07-26 57 views
2

我們在OpsCenter 5.2.4中使用DSE 4.8.8。我們所有的OpsCenter.rollups*表永遠增長,尤其是rollups60一個:OpsCenter彙總*表正在永久生長

Size of rollups60, 1 month

密鑰空間的OpsCenter使用org.apache.cassandra.locator.NetworkTopologyStrategy,DC1 1,DC2 1

表設置:

CREATE TABLE "OpsCenter".rollups60 (
    key text, 
    "timestamp" varint, 
    value blob, 
    PRIMARY KEY (key, "timestamp") 
) WITH COMPACT STORAGE 
    AND CLUSTERING ORDER BY ("timestamp" ASC) 
    AND bloom_filter_fp_chance = 0.01 
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}' 
    AND comment = '{"info": "OpsCenter management data.", "version": [5, 2, 1]}' 
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'} 
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'} 
    AND dclocal_read_repair_chance = 0.0 
    AND default_time_to_live = 0 
    AND gc_grace_seconds = 0 
    AND max_index_interval = 2048 
    AND memtable_flush_period_in_ms = 0 
    AND min_index_interval = 128 
    AND read_repair_chance = 0.25 
    AND speculative_retry = 'NONE'; 

條目在列keytimestamp上沒有TTL,列value上的TTL爲604618。

任何想法如何解決這個問題?我已經嘗試了截斷的描述在這裏:Datastax support

回答

0

您可以通過羣集配置文件中設置1分鐘(彙總60表)TTL:https://docs.datastax.com/en/latest-opsc/opsc/configure/opscChangingPerformanceDataExpiration_t.html

[cassandra_metrics] 

1min_ttl = 43200 
5min_ttl = 1209600 
2hr_ttl = 0 
24hr_ttl = 0 

這也可以在address.yaml各設置的代理人。一次更容易設置OpsCenter羣集配置。

您可以稍微調整表格設置以改善清除墓碑。

ALTER TABLE "OpsCenter".rollups60 WITH 
    compaction = {'class': 'SizeTieredCompactionStrategy', 
    'tombstone_compaction_interval': '1', 
    'unchecked_tombstone_compaction': 'true', 
    'tombstone_threshold': '0.05'} AND 
    gc_grace_seconds = 0 

要更激進,您可以使用LCS,但這會增加IO使用量。爲了你的情況,儘管它可能是好的(至少在上面的ttl選項),你實際上不會有那麼多的數據存儲。

ALTER TABLE "OpsCenter".rollups60 WITH 
    compaction = {'class': 'LeveledCompactionStrategy', 
    'sstable_size_in_mb': '256mb', 
    'tombstone_compaction_interval': '1', 
    'unchecked_tombstone_compaction': 'true', 
    'tombstone_threshold': '0.05'} AND 
    gc_grace_seconds = 0