How can I reduce the size of my Zookeeper Data folder if it grows huge?

QUESTION:
How can I reduce the size of my Zookeeper Data folder if it grows huge?

ANSWER:
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*
changed:
vds.conf.versioning=true
to:
vds.conf.versioning=false
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:
zookeeper.compress.orxdvx=true
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

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.

Articles in this section

See more