How can I reduce the size of my Zookeeper Data folder if it grows huge?
You need to perform these steps cautiously.
First, Stop everything on all Nodes
1. Go to %RLI_HOME%\apps\zookeeper\data\version-2 and delete the unnecessary log and snapshot files.
**NOTE**: Do *not* delete all of the snapshot files. You must keep the most recent one because that is what preserves all your configurations. You want to delete all the old ones
and keep just the most recent one. So check the time stamps
2. Edit %RLI_HOME%\config\advanced\features.properties file on *all nodes*
3. Run cluster.bat zk-delete vds_server /radiantone/v1/cluster/config/org/<orx file> on all the unnecessary orx files
4. Run cluster.bat zk-delete vds_server /radiantone/v1/cluster/config/lod/<orx file> on all the unnecessary orx files
5. Run cluster.bat zk-delete vds_server /radiantone/v1/cluster/config/dvx/<dvx file> on all the unnecessary dvx files
6. Run cluster.bat zk-config-versioning-compact command to compress config-versioning folder
Start everything back on all nodes starting with leader first.
Finally: Check and delete any unused naming contexts/pcache from VDS Control Panel > Directory Namespace
You can also enable compression/zipping of the orx/dvx files with the following steps:
NOTE - These steps require the whole cluster to be stopped, so perform during non-peak/maintenance window.
0) ALL NODES: stop all the services
You need everything stopped except ZK which must be started on all the nodes (we are going to write in it).
1) Do a ZK Backup
On any node:
$ ./bin/advanced/cluster.sh zk-export vds_server /tmp/zk-export /radiantone/v1/cluster
2) Enable the compression
On ALL NODES: update $RLI_HOME/config/advanced/features.properties with:
3) Delete existing data
$ ./bin/advanced/cluster.sh zk-delete vds_server /radiantone/v1/cluster
4) Reimport the ZK data
On any node (where you did the backup) (not on all the nodes):
$ ./bin/advanced/cluster.sh zk-import vds_server /tmp/zk-export /radiantone/v1/cluster
Reuploading will save the data but this time it will be compressed since the feature is turned on.
5) Restart all the ZK