diff --git a/AppController/lib/zookeeper_helper.rb b/AppController/lib/zookeeper_helper.rb index a3e2ea94df..b426e779ba 100644 --- a/AppController/lib/zookeeper_helper.rb +++ b/AppController/lib/zookeeper_helper.rb @@ -20,6 +20,8 @@ def configure_zookeeper(nodes, my_index) maxClientsCnxns=0 forceSync=no skipACL=yes +autopurge.snapRetainCount=5 +autopurge.purgeInterval=12 EOF myid = "" diff --git a/scripts/zookeeper-cleanup.sh b/scripts/zookeeper-cleanup.sh deleted file mode 100644 index 10dc301dd8..0000000000 --- a/scripts/zookeeper-cleanup.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# -# Cleanup old Zookeeper transactions. -# - -MONIT_CMD="$(which monit)" -LOG4J_CONF="/root/log4j.xml" -ZK_DIR="/opt/appscale/zookeeper" - -# Sanity checks. -if [ -z "${MONIT_CMD}" ]; then - echo "Cannot find monit!" - exit 1 -fi -if [ ! -d "${ZK_DIR}" ]; then - echo "Cannot find Zookeeper directory!" - exit 2 -fi - -# Run only on Zookeeper node. -if [ ! ${MONIT_CMD} summary | grep zookeeper > /dev/null ]; then - echo "Zookeeper is not running." - exit 1 -fi - -# Create configuration for log4j. -if [ ! -e ${LOG4J_CONF} ]; then - cat < ${LOG4J_CONF} - - - - - - - - - - - - - - - - - -EOF -fi - -# Clean Zookeeper transactions. -java -cp /root/:/usr/lib/zookeeper/zookeeper.jar:/usr/lib/zookeeper/lib/slf4j-api-1.6.1.jar:/usr/lib/zookeeper/lib/slf4j-log4j12-1.6.1.jar:/usr/lib/zookeeper/liblog4j-1.2.15.jar:conf:/usr/lib/zookeeper/lib/* -Dlog4j.debug org.apache.zookeeper.server.PurgeTxnLog ${ZK_DIR} ${ZK_DIR} -n 3 -