InfluxDB Operations
Ingestion, retention and downsampling tasks, clustering, backup and the metrics to monitor.
Commands below use the 2.x CLI. Confirm the equivalents for your major version before running anything — see the version note in InfluxDB Data Model.
Ingestion
influx write --bucket metrics --precision s --file batch.lpBatching is essential: thousands of points per request rather than one point per request. Telegraf is the usual collection agent and buffers on the client side, which protects against a backend restart.
Practical guidance:
- Use the coarsest timestamp precision your data justifies.
- Sort points by series where the client makes that easy; it improves compression.
- Handle write rejections explicitly — a silently dropped batch is data loss.
Retention and downsampling
influx bucket create --name metrics_raw --retention 7d
influx bucket create --name metrics_daily --retention 730dA scheduled task aggregates raw data into the longer-retention bucket:
option task = { name: "downsample-hourly", every: 1h }
from(bucket: "metrics_raw")
|> range(start: -2h)
|> filter(fn: (r) => r._measurement == "readings")
|> aggregateWindow(every: 1h, fn: mean)
|> to(bucket: "metrics_daily")Clustering
Clustering has differed by version and edition. The open-source distribution has historically been single-node, with horizontal scaling available in commercial offerings.
Backup and restore
influx backup /backups/influx-$(date -u +%Y%m%dT%H%M%SZ) --token $INFLUX_TOKEN
influx restore /backups/influx-20260731T020000Z --token $INFLUX_TOKEN
# Restore one bucket into a new name to verify without touching production.
influx restore /backups/influx-20260731T020000Z \
--bucket metrics --new-bucket metrics_verify --token $INFLUX_TOKENMonitoring
InfluxDB exposes Prometheus-format metrics at /metrics.
Watch:
- Series cardinality per bucket — the leading indicator of trouble. See Cardinality.
- Write and query request rates, errors and durations.
- Task execution success and last-run time for every downsampling task.
- Disk usage for the data directory and the WAL, with a growth projection.
- Memory usage, which tracks the index and therefore cardinality.
- Dropped or rejected writes, which are data you did not store.
influx bucket list
influx task list
influx task retry-failed --id <task-id>Alert on cardinality growth rate rather than only on an absolute threshold — a doubling in a day is a deploy that added a tag, and catching it early is far cheaper than recovering afterwards.