Skip to content
Python library for Parsing and Validating ZooKeeper configuration file http://hadoop.apache.org/zookeeper/
Python
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
samples
.gitignore
LICENSE
README
setup.py
test.py
zoocfg.py

README

ZooKeeper Config Parser & Validator
-----------------------------------

Target: ZooKeeper 3.3.x

Author: Andrei Savu -- http://www.andreisavu.ro/  

Development status: Experimental

A Python class for Parsing and Validating ZooKeeper config files.

Usage
-----

This class can be used in two ways:

* by importing it in your scripts

    from zoocfg import ZooCfg, Rules

    cfg = ZooCfg.from_file('zoo.cfg')
    cfg = ZooCfg(file_content)

    check = Rules.check_all(cfg)
    if check.has_errors():
        # we've got errors in the configuration file

    if check.has_warnings():
        # some things are strange

* or by using the command-line tool

    ./zoocfg.py -f zoo.cfg -w
    -- will output errors and warnings found while checking the rules

Typical output
--------------


$ ./zoocfg.py -f samples/standalone-zoo.cfg -w
Warnings:
* You should run at least 3 ZooKeeper servers.

* The `dataLogDir` should not use the same partition as `dataDir` in order to avoid competition between logging and snapshots. Having a dedicated log device has a large impact on throughput and stable latencies.


$ ./zoocfg.py -f samples/replicated-zoo.cfg -w
Warnings:
* The `dataLogDir` should not use the same partition as `dataDir` in order to avoid competition between logging and snapshots. Having a dedicated log device has a large impact on throughput and stable latencies.

* `dataDir` contains a relative path. This could be a problem if ZooKeeper is running as daemon.

* Your ensemble contains more than 3 servers. It's recommended to set `leaderServers` to `no`. This willallow the leader to focus only on coordination.


ZooKeeper config rules
----------------------

http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.html#sc_configuration

Known Issues
------------

* no support for hierarhical groups and weights
* no support for observers

Something went wrong with that request. Please try again.