1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

influx retention policy not found: default

Posted at

普通に保存しようとしたら下記エラーが

{"error":"retention policy not found: default"}
> settings
Setting           Value
--------          --------
Host              localhost:8086
Username          xxxxx
Database          myDatabase
RetentionPolicy   # 確かにない ...
Pretty            false
Format            column
Write Consistency all
Chunked           true
Chunk Size        0
$ influx -username root -password root
Connected to http://localhost:8086 version 1.3.9
InfluxDB shell version: 1.3.9
> use myDatabase
> CREATE RETENTION POLICY "default" ON "myDatabase" DURATION 7d REPLICATION 1
> show retention policies on myDatabase
name    duration shardGroupDuration replicaN default
----    -------- ------------------ -------- -------
autogen 0s       168h0m0s           1        true
default 168h0m0s 24h0m0s            1        false

そもそも変な時間で送ってたのが問題だったのかも
ダミーだからといって一年前とかを指定してたし。

default 作ってから1年前データ送ると下記のように怒られたため

{"error":"partial write: points beyond retention policy dropped=1"}

policyの範囲外にあたるデータは送れないとのこと
とりあえずの決めで7dを保存期間としたので、一昨日の日付でインサートするようにしたら通った。

時系列DBなのでダミーデータといえど特に必要ない限りは直近の時刻で入れた方がよいのかも

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?