"Fossies" - the Fresh Open Source Software Archive

Member "apache-zookeeper-3.8.1/zookeeper-contrib/zookeeper-contrib-zktreeutil/README.txt" (25 Jan 2023, 3962 Bytes) of package /linux/misc/apache-zookeeper-3.8.1.tar.gz:

As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 ==========================================
    2 zktreeutil - Zookeeper Tree Data Utility
    3 Author: Anirban Roy
    4 Organization: Yahoo Inc.
    5 ==========================================
    7 zktreeutil program is intended to manage and manipulate zk-tree data quickly, effi-
    8 ciently and with ease. The utility operates on free-form ZK-tree and hence can be used
    9 for any cluster managed by Zookeeper. Here are the basic functionalities -
   11 EXPORT: The whole/partial ZK-tree is exported into a XML file. This helps in
   12 capturing a current snapshot of the data for backup/analysis. For a subtree
   13 export, one need to specify the path to the ZK-subtree with proper option.
   15 IMPORT: The ZK-tree can be imported from XML into ZK cluster. This helps in priming
   16 the new ZK cluster with static configuration. The import can be non-intrusive by
   17 making only the additions in the existing data. The import of subtree is also
   18 possible by optionally providing the path to the ZK-subtree.
   20 DIFF: Creates a diff between live ZK data vs data saved in XML file. Diff can ignore
   21 some ZK-tree branches (possibly dynamic data) on reading the optional ignore flag
   22 from XML file. Diffing on a ZK-subtree achieved by providing path to ZK-subtree with
   23 diff command.
   25 UPDATE: Make the incremental changes into the live ZK-tree from saved XML, essentia-
   26 lly after running the diff.
   28 DUMP: Dumps the ZK-tree on the standard output device reading either from live ZK
   29 server or XML file. Like export, ZK-subtree can be dumped with optionaly
   30 providing the path to the ZK-subtree, and till a certain depth of the (sub)tree.
   32 The exported ZK data into XML file can be shortened by only keeping the static ZK
   33 nodes which are required to prime a cluster. The dynamic zk nodes (created on-the-
   34 fly) can be ignored by setting a 'ignore' attribute at the root node of the dynamic
   35 subtree (see tests/zk_sample.xml), possibly deleting all inner ZK nodes under that.
   36 Once ignored, the whole subtree is ignored during DIFF, UPDATE and WRITE.
   38 Pre-requisites
   39 --------------
   40 1. Linux system with 2.6.X kernel.
   41 2. Zookeeper C client library (locally built at ../../c/.libs) >= 3.X.X
   42 3. Development build libraries (rpm packages):
   43   a. boost-devel >= 1.32.0
   44   b. libxml2-devel >= 2.7.3
   45   c. log4cxx0100-devel >= 0.10.0
   47 Build instructions
   48 ------------------
   49 1. cd into this directory
   50 2. autoreconf -if
   51 3. ./configure
   52 4. make
   53 5. 'zktreeutil' binary created under src directory
   55 Limitations
   56 -----------
   57 Current version works with text data only, binary data will be supported in future
   58 versions.
   60 Testing  and usage of zktreeutil
   61 --------------------------------
   62 1.  Run Zookeeper server locally on port 2181
   63 2.  export LD_LIBRARY_PATH=../../c/.libs/:/usr/local/lib/
   64 3.  ./src/zktreeutil --help # show help
   65 4.  ./src/zktreeutil --zookeeper=localhost:2181 --import --xmlfile=tests/zk_sample.xml 2>/dev/null                 # import sample ZK tree
   66 5.  ./src/zktreeutil --zookeeper=localhost:2181 --dump --path=/myapp/version-1.0 2>/dev/null                         # dump Zk subtree 
   67 5.  ./src/zktreeutil --zookeeper=localhost:2181 --dump --depth=3 2>/dev/null                                                 # dump Zk tree till certain depth
   68 6.  ./src/zktreeutil --xmlfile=zk_sample.xml -D 2>/dev/null                                                                     # dump the xml data
   69 7.  Change zk_sample.xml with adding/deleting/chaging some nodes 
   70 8.  ./src/zktreeutil -z localhost:2181 -F -x zk_sample.xml -p /myapp/version-1.0/configuration 2>/dev/null          # take a diff of changes
   71 9.  ./src/zktreeutil -z localhost:2181 -E 2>/dev/null > zk_sample2.xml                                                         # export the mofied ZK tree
   72 10. ./src/zktreeutil -z localhost:2181 -U -x zk_sample.xml -p /myapp/version-1.0/distributions 2>/dev/null        # update with incr. changes
   73 11. ./src/zktreeutil --zookeeper=localhost:2181 --import --force --xmlfile=zk_sample2.xml 2>/dev/null             # re-prime the ZK tree