WAS THIS PAGE HELPFUL? Leave Feedback
Overview
An InfluxDB data retention policy applies across all measurements stored in an InfluxDB database. Data in the GroundWork InfluxDB databases older than this will automatically be deleted by InfluxDB. The default retention policy for GroundWork InfluxDB databases is 56 weeks of raw data. This was chosen as the default to allow annual reporting and comparison to the current date and one year past. This aids in spotting annual patterns. You can create and use new retention policies easily. See the InfluxData documentation Downsampling and Retention for more information on altering retention policies.
Examples
Example of viewing existing retention polices
- To view the existing retention policies for the groundwork database, enter the following command:
/usr/local/groundwork/influxdb/bin/influx -execute 'show retention policies on "groundwork"'
You should see something similar to this:
name duration shardGroupDuration replicaN default ---- -------- ------------------ -------- ------- autogen 0s 168h0m0s 1 false groundwork_56_weeks 9408h0m0s 168h0m0s 1 true
Example of creating a new default retention policy
- To create a new 10 week retention policy on the groundwork database and make this policy the new default, enter the following command:
/usr/local/groundwork/influxdb/bin/influx -execute 'create retention policy "groundwork_10_weeks" on "groundwork" duration 10w replication 1 default'
- Viewing with the first command from above, you should see something similar to this:
name duration shardGroupDuration replicaN default ---- -------- ------------------ -------- ------- autogen 0s 168h0m0s 1 false groundwork_56_weeks 9408h0m0s 168h0m0s 1 false groundwork_10_weeks 1680h0m0s 24h0m0s 1 true
Example of changing the default retention policy
- To switch the default retention policy on the groundwork database to the groundwork_56_weeks policy, enter the following command:
/usr/local/groundwork/influxdb/bin/influx -execute 'alter retention policy "groundwork_56_weeks" on "groundwork" default'
- Viewing with the first command from above, you should see something similar to this:
name duration shardGroupDuration replicaN default ---- -------- ------------------ -------- ------- autogen 0s 168h0m0s 1 false groundwork_56_weeks 9408h0m0s 168h0m0s 1 true groundwork_10_weeks 1680h0m0s 24h0m0s 1 false