• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
ZooKeeper | Command Line Utilities: "zkCli"
  1. Command Line Utilities
  2. zkCli commands
  3. View commands history
  4. Create zNodes
  5. Set data to a zNode
  6. Get data of a zNode
  7. ZooKeeper ensemble configuration
  8. Close connection to ZooKeeper
  9. Connect to ZooKeeper
  10. Quit zkCli
  11. Remove an instance from ZooKeeper ensemble
  12. Add new instance to ZooKeeper ensemble

  1. Command Line Utilities
    The ZooKeeper client provides a list of commands that allow you to access and manipulate zNodes in ZooKeeper.

    You can run the command line and specify one or multiple ZooKeeper instances:



    You can execute directly a command as follows:
  2. zkCli commands
    • history
    • version
    • whoami

    • connect host:port
    • close

    • quit

    • config [-c] [-w] [-s]
    • reconfig [-s] [-v version] [[-file path] | [-members serverID=host:port1:port2;port3[,...]*]] | [-add serverId=host:port1:port2;port3[,...]]* [-remove serverId[,...]*]

    • ls [-s] [-w] [-R] path
    • stat [-w] path

    • get [-s] [-w] [-b] [-x] path
    • getAllChildrenNumber path
    • getEphemerals path

    • set path data [-s] [-v version] [-b]

    • getAcl [-s] path
    • setAcl [-s] [-v version] [-R] path acl

    • create [-s] [-e] [-c] [-t ttl] path [data] [acl]

    • delete [-v version] path
    • deleteall path [-b batch size]

    • addauth scheme auth

    • listquota path
    • setquota -n|-b|-N|-B val path
    • delquota [-n|-b|-N|-B] path

    • addWatch [-m mode] path # optional mode is one of [PERSISTENT, PERSISTENT_RECURSIVE] - default is PERSISTENT_RECURSIVE
    • printwatches on|off
    • removewatches path [-c|-d|-a] [-l]

    • redo cmdno

    • sync path
  3. View commands history
  4. Create zNodes
    Create zNode:
    Create zNode with data:
  5. Set data to a zNode
  6. Get data of a zNode
  7. ZooKeeper ensemble configuration
  8. Close connection to ZooKeeper
  9. Connect to ZooKeeper


  10. Quit zkCli
  11. Remove an instance from ZooKeeper ensemble
    Check the following constraints of the reconfig command:
    ► You get an error if "reconfigEnabled" is disabled (default): "reconfigEnabled" ► You need to enable the option "reconfigEnabled=true" in the configuration file ("zoo.cfg").
    ► You have to authenticate with an authorized user to execute the "reconfig" command (see this page zk-super-user.php for instructions on how to create an authorized user).

  12. Add new instance to ZooKeeper ensemble
© 2025  mtitek