Parece que você entendeu mal o znodes
.
Unlike is standard file systems, each node in a ZooKeeper namespace can have data associated with it as well as children. It is like having a file-system that allows a file to also be a directory. (ZooKeeper was designed to store coordination data: status information, configuration, location information, etc., so the data stored at each node is usually small, in the byte to kilobyte range.) We use the term znode to make it clear that we are talking about ZooKeeper data nodes.
Eu costumava usar zk-shell
para gerenciar Zookeeper
. zk-shell
permite que você veja a árvore completa de znodes
. No final de README.md
, você tem um exemplo com a criação e o gerenciamento de znodes
, incluindo o processo de criação e remoção.
(CONNECTED) /> create /source/znode1/znode11 'Hello' false false true (CONNECTED) /> create /source/znode2 'Hello' false false true (CONNECTED) /> create /target/znode1/znode12 'Hello' false false true (CONNECTED) /> create /target/znode3 'Hello' false false true (CONNECTED) /> tree . ├── target │ ├── znode3 │ ├── znode1 │ │ ├── znode12 ├── source │ ├── znode2 │ ├── znode1 │ │ ├── znode11 ├── zookeeper │ ├── config │ ├── quota (CONNECTED) /> mirror /source /target Are you sure you want to replace /target with /source? [y/n]: y Mirroring took 0.04 secs (CONNECTED) /> tree . ├── target │ ├── znode2 │ ├── znode1 │ │ ├── znode11 ├── source │ ├── znode2 │ ├── znode1 │ │ ├── znode11 ├── zookeeper │ ├── config │ ├── quota (CONNECTED) /> create /target/znode4 'Hello' false false true (CONNECTED) /> mirror /source /target false false true Mirroring took 0.03 secs (CONNECTED) />
Há algum tempo, criei uma imagem do Docker que permite que você crie e execute facilmente, docker-python3-zkshell
. Sinta-se à vontade para usá-lo.
Referências: