influxdb 數(shù)據(jù)存儲規(guī)則修改

# 查看庫存儲規(guī)則
> SHOW RETENTION POLICIES ON spider_record;
[out]: 
name    duration shardGroupDuration replicaN default
----    -------- ------------------ -------- -------
autogen 720h0m0s 168h0m0s           1        true
# 修改存儲規(guī)則
> ALTER RETENTION POLICY autogen ON spider_record DURATION 720h;
# 設(shè)為默認(rèn)
> ALTER RETENTION POLICY autogen ON spider_record DEFAULT;
# 刪除規(guī)則
> drop  retention POLICY rule_01 ON spider_record;
#創(chuàng)建規(guī)則
> CREATE RETENTION POLICY "rule_01" ON spider_record DURATION 360h REPLICATION 1;
> SHOW RETENTION POLICIES ON spider_record;
[out]
name    duration shardGroupDuration replicaN default
----    -------- ------------------ -------- -------
autogen 0s       168h0m0s           1        true
rule_01 360h0m0s 24h0m0s            1        false

# 字段含義
name--名稱,此示例名稱為 autogen 

duration--持續(xù)時間,0代表無限制

shardGroupDuration--shardGroup的存儲時間,shardGroup是InfluxDB的一個基本儲存結(jié)構(gòu),應(yīng)該大于這個時間的數(shù)據(jù)在查詢效率上應(yīng)該有所降低。

replicaN--全稱是REPLICATION,副本個數(shù)

default--是否是默認(rèn)策略

DOCUMENT: http://www.itdecent.cn/writer#/notebooks/31848360/notes/42196019/preview
InfluxDB stores data in shard groups. A single shard group covers a specific time interval; InfluxDB determines that time interval by looking at the DURATION of the relevant retention policy (RP). The table below outlines the default relationship between the DURATION of an RP and the time interval of a shard group:

RP duration Shard group interval
< 2 days 1 hour
>= 2 days and <= 6 months 1 day
> 6 months 7 days

Users can also configure the shard group duration with the CREATE RETENTION POLICY and ALTER RETENTION POLICY statements. Check your retention policy’s shard group duration with the SHOW RETENTION POLICY statement.

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,817評論 0 10
  • 這張圖給出了如何成為一個能培養(yǎng)孩子堅毅性格的父母的答案。得到支持:(溫暖)我有問題可以從父母那里得到幫助(最壞的就...
    伍帆閱讀 319評論 0 0
  • 今天是八月十五中秋節(jié)。是闔家團圓的節(jié)日!家人們都聚在一起吃團圓飯,晚上一起賞月!以前在老家的時候爸爸總也不回家,每...
    崔珂豪本人閱讀 653評論 0 1
  • 《野鬼 野鬼》 文/禹卿 抽一口蘭州回味,你轉(zhuǎn)身 把黃河水喝醉 臘子口的風(fēng)帶著你的背影回家 把...
    葉好x閱讀 274評論 2 2

友情鏈接更多精彩內(nèi)容