Removing telegraf data for old hosts

I have not been successful in removing telegraf data collected from hosts that are no longer exist. I have reviewed numerous articles and tried everything I could find and get to execute properly, from what I can tell, and the hosts still show up in the Grafana dashboard with no data.

Steps I have taken:

  1. From the influx directory on the host, influx /#run influxdb client shell
  2. Use telegraf /# select the telegraf database
  3. SHOW TAG VALUES FROM win_system WITH KEY=host /# List all host names
  4. drop series where host=’<for_each_stale_host_name>’ /# Remove host data
  5. show series where host=’<for_each_stale_host_name>’ /# Confirm host name is gone
  6. Stop influx db
  7. Delete all folders under .\data\telegraf\_series
  8. influx_inspect buildtsi -datadir .\data -waldir .\wal /# Rebuild the indexes
  9. Restart influxdb

Am I missing a step? Has this worked for anyone else?

Version
Connected to http://localhost:8086 version 1.7.10
InfluxDB shell version: 1.7.8

You need to wait for the shards to roll over and run a compaction. Then you can do the re index

Thanks for the info.

Is there any way to monitor the rollover of the shards or to force them?

It looks like there is no way to initiate a manual compaction according to the docs. The only option is to do a full compaction at influxdb launch via a config file flag.

https://docs.influxdata.com/influxdb/v1.7/troubleshooting/frequently-asked-questions/#how-do-i-manually-trigger-a-compaction

In enterprise there is a command truncate-shards but there is not for OSS

Thanks for the quick reply. Since there is not way in OSS to force shard rollover, is there a way to monitor progress to know when it is complete?