Skip to content

Instantly share code, notes, and snippets.

@jaytaylor
Created July 6, 2017 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaytaylor/708a60adceb4360a2746eb5bc128c928 to your computer and use it in GitHub Desktop.
Save jaytaylor/708a60adceb4360a2746eb5bc128c928 to your computer and use it in GitHub Desktop.
Zookeeper cleaner upper.
#!/usr/bin/env bash
##
# Useful reference and documentation material:
#
# https://zookeeper.apache.org/doc/r3.3.2/zookeeperAdmin.html#Ongoing+Data+Directory+Cleanup
set -o errexit
set -o pipefail
set -o nounset
cd /usr/share/zookeeper
. bin/zkEnv.sh
java -cp zookeeper-3.4.9.jar:$(find lib -name '*.jar' | tr '\n' ':'):conf org.apache.zookeeper.server.PurgeTxnLog /opt/zookeeper/log /opt/zookeeper/data -n 3
@jaytaylor
Copy link
Author

Note

Zookeeper 3.4.x and newer include autopurge functionality. Should work better than this script ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment