Skip to content

Instantly share code, notes, and snippets.

@tkishel
Created July 17, 2019 16:42
Show Gist options
  • Save tkishel/9eca66ac8729f28d50266c25204b643a to your computer and use it in GitHub Desktop.
Save tkishel/9eca66ac8729f28d50266c25204b643a to your computer and use it in GitHub Desktop.
Prune PuppetDB Stockpile Queue

PuppetDB only stores one catalog and factset per node (but n number of reports), so deleting older catalog and fact queue files older than an hour (given runinterval=30) could allow PuppetDB to catch up on the queue, and would not have an impact on the data in PostgreSQL. To delete older catalogs and factsets (that would have been replaced by newer catalogs and factsets) from the PuppetDB queue:

find /opt/puppetlabs/server/data/puppetdb/stockpile/cmd/q -name "*_catalog_9_*.json.gz" -mmin +60 -delete
find /opt/puppetlabs/server/data/puppetdb/stockpile/cmd/q -name "*_facts_5_*.json.gz" -mmin +60 -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment