Created
July 6, 2017 17:44
-
-
Save jaytaylor/708a60adceb4360a2746eb5bc128c928 to your computer and use it in GitHub Desktop.
Zookeeper cleaner upper.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note
Zookeeper 3.4.x and newer include autopurge functionality. Should work better than this script ;)