Edge for Private Cloud v4.18.01
Four-Letter Commands
Apache ZooKeeper has a number of "four-letter commands" that can be helpful in determining the current status of ZooKeeper voter and observer nodes. These commands can be invoked using "nc", "telnet" or another utility that has the ability to send commands to a specific port. Details on the four-letter commands can be found at:
http://zookeeper.apache.org/doc/r3.1.2/zookeeperAdmin.html#sc_zkCommands.
Removing Old Snapshot Files
Apache ZooKeeper automatically performs periodic maintenance to remove old snapshot files which accumulate as updates to the system are made. The following settings in /opt/apigee/apigee-zookeeper/conf/zoo.cfg control this process:
## The number of snapshots to retain in dataDir: autopurge.snapRetainCount=5 # Purge task interval in hours. # Set to "0" to disable auto purge feature. autopurge.purgeInterval=120
To set these properties to different values:
- Edit /opt/apigee/customer/application/zookeeper.properties to set the following properties. If that file does not exist, create it.
- Set the following properties in zookeeper.properties:
# Set the snapshot count. In this example set it to 10:
conf_zoo_autopurge.snapretaincount=10
# Set the purge interval. In this example, set is to 240 hours:
conf_zoo_autopurge.purgeinterval=240 - Make sure the file is owned by the "apigee" user:
> chown apigee:apigee /opt/apigee/customer/application/zookeeper.properties - Restart ZooKeeper by using the command:
$ /opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper restart
Log File Maintenance
Apache Zookeeper log files are kept in /opt/apigee/var/log/apache-zookeeper. Normally, log file maintenance should not be required, but if you find that there are an excessive number of ZooKeeper logs or that the logs are very large you can modify ZooKeeper’s log4j properties to set the maximum file size and file count.
- Edit /opt/apigee/customer/application/zookeeper.properties to set the following properties. If that file does not exist, create it.
- Set the following properties in zookeeper.properties:
conf_log4j_log4j.appender.rollingfile.maxfilesize=10MB # max file size
conf_log4j_log4j.appender.rollingfile.maxbackupindex=50 # max open files - Make sure the file is owned by the "apigee" user:
> chown apigee:apigee /opt/apigee/customer/application/zookeeper.properties - Restart ZooKeeper by using the command:
$ /opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper restart