Open agn-7 opened 2 years ago
Hi @Hipska
I have tested with Docker influxdb:2.2.0-alpine container with env variable DOCKER_INFLUXDB_INIT_RETENTION and got a similar issue.
The bucket always is infinite no matter what retention I set.
Is this a correct way to define retention with the official Influxdb container?
I also try to update the retention of an existing bucket with CLI. It seems CLI can assign the retention of the bucket.
After applying retention, I expect to see the influxdb clean older data, but all 4 days' data still remain there. Should I try to apply the new retention policy?
-- Update
I think I figure out the problem. The root cause is the initial retention settings are always in /etc/influxdb2 which is mounted to a folder of the host. Every time I recreate a container, it always refers to the existing and old config which's retention is infinite. Now I can create a container with any retention policy that I want after cleaning up the volume (i.e. /etc/influxdb2). FYR.
-- Update
I think I figure out the problem. The root cause is the initial retention settings are always in /etc/influxdb2 which is mounted to a folder of the host. Every time I recreate a container, it always refers to the existing and old config which's retention is infinite. Now I can create a container with any retention policy that I want after cleaning up the volume (i.e. /etc/influxdb2). FYR.
@chc69 , can you please elaborate on this? /etc/influxdb2/
is empty by default on influxdb:2.7.5
I use influxdb v1.7.11 in a docker container. I read there is an env var in hub.docker influxdb description in order to set a retention policy on a database. However, it doesn't work!
Here's a piece of my
docker-compose.yml
: