influxdbデータストレージ規則の変更

1794 ワード

#  
> SHOW RETENTION POLICIES ON spider_record;
[out]: 
name    duration shardGroupDuration replicaN default
----    -------- ------------------ -------- -------
autogen 720h0m0s 168h0m0s           1        true
#  
> ALTER RETENTION POLICY autogen ON spider_record DURATION 720h;
#  
> ALTER RETENTION POLICY autogen ON spider_record DEFAULT;
#  
> drop  retention POLICY rule_01 ON spider_record;
# 
> 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-- ,0 

shardGroupDuration--shardGroup ,shardGroup InfluxDB , 。

replicaN-- REPLICATION, 

default-- 

DOCUMENT: https://www.jianshu.com/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.