不同K线生成不同的数据库和不同的保留策略 - Xiaotian0617/Center GitHub Wiki

CREATE DATABASE "Kline1m" WITH DURATION 1d REPLICATION 1 SHARD DURATION 1h NAME "1d"; CREATE DATABASE "Kline3m" WITH DURATION 3d REPLICATION 1 SHARD DURATION 1h NAME "3d"; CREATE DATABASE "Kline5m" WITH DURATION 5d REPLICATION 1 SHARD DURATION 1h NAME "5d"; CREATE DATABASE "Kline10m" WITH DURATION 10d REPLICATION 1 SHARD DURATION 1h NAME "10d"; CREATE DATABASE "Kline15m" WITH DURATION 15d REPLICATION 1 SHARD DURATION 1h NAME "15d"; CREATE DATABASE "Kline30m" WITH DURATION 30d REPLICATION 1 SHARD DURATION 1h NAME "30d"; CREATE DATABASE "Kline1h" WITH DURATION 60d REPLICATION 1 SHARD DURATION 1h NAME "60d"; CREATE DATABASE "Kline2h" WITH DURATION 120d REPLICATION 1 SHARD DURATION 1h NAME "120d"; CREATE DATABASE "Kline4h" WITH DURATION 240d REPLICATION 1 SHARD DURATION 1h NAME "240d"; CREATE DATABASE "Kline6h" WITH DURATION 360d REPLICATION 1 SHARD DURATION 1h NAME "360d"; CREATE DATABASE "Kline12h" WITH DURATION 720d REPLICATION 1 SHARD DURATION 1h NAME "720d"; CREATE DATABASE "Kline1d" WITH DURATION INF REPLICATION 1 SHARD DURATION 1h NAME "1dINF"; CREATE DATABASE "Kline3d" WITH DURATION INF REPLICATION 1 SHARD DURATION 1h NAME "3dINF"; CREATE DATABASE "Kline7d" WITH DURATION INF REPLICATION 1 SHARD DURATION 1h NAME "7dINF"; CREATE DATABASE "Kline1w" WITH DURATION INF REPLICATION 1 SHARD DURATION 1h NAME "1wINF";

CREATE DATABASE "PriceRate";

CREATE RETENTION POLICY "1d" ON "PriceRate" DURATION 1d REPLICATION 2; CREATE RETENTION POLICY "3d" ON "PriceRate" DURATION 3d REPLICATION 2; CREATE RETENTION POLICY "5d" ON "PriceRate" DURATION 5d REPLICATION 2; CREATE RETENTION POLICY "10d" ON "PriceRate" DURATION 10d REPLICATION 2; CREATE RETENTION POLICY "15d" ON "PriceRate" DURATION 15d REPLICATION 2; CREATE RETENTION POLICY "30d" ON "PriceRate" DURATION 30d REPLICATION 2; CREATE RETENTION POLICY "60d" ON "PriceRate" DURATION 60d REPLICATION 2; CREATE RETENTION POLICY "120d" ON "PriceRate" DURATION 120d REPLICATION 2; CREATE RETENTION POLICY "240d" ON "PriceRate" DURATION 240d REPLICATION 2; CREATE RETENTION POLICY "360d" ON "PriceRate" DURATION 360d REPLICATION 2; CREATE RETENTION POLICY "720d" ON "PriceRate" DURATION 720d REPLICATION 2; CREATE RETENTION POLICY "1dINF" ON "PriceRate" DURATION INF REPLICATION 2; CREATE RETENTION POLICY "3dINF" ON "PriceRate" DURATION INF REPLICATION 2; CREATE RETENTION POLICY "7dINF" ON "PriceRate" DURATION INF REPLICATION 2;