Show Table of Contents
9.4. Purging the ZooKeeper Snapshot and Transaction Logs
Overview
The ZooKeeper Data Directory contains snapshot and transactional log files which are persistent copy of the znodes stored by an ensemble. Any changes to znodes are appended to transaction log and when the log file size increases, a snapshot of the current state of znodes is written to the filesystem. ZooKeeper tracks a fuzzy state of its own data tree within the snapshot files. This data tree is constantly evolving.
To clean up and purge the snapshot and transaction logs from ZooKeeper, you can invoke the ZooKeeper autopurge functionality using the
--zookeeper-purge-interval and --zookeeper-snap-retain-count parameters on the fabric:create command.
fabric:create Parameters for Zookeeper autopurge
Table 9.1. Zookeeper autopurge Parameters
| Parameter | Description |
|---|---|
| --zookeeper-purge-interval | Set the interval in hours between triggers of the autopurge task. Must be set to a positive integer (1 and above). The default is 0. |
| --zookeeper-snap-retain-count | Define the number of recent Snapshots and corresponding transaction logs in the dataDir and dataLogDir to retain on autopurge. The minimum number is 3. |

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.