openstack-charmers / charm-zookeeper-k8s

Zookeeper k8s sidecar charm
Apache License 2.0
1 stars 1 forks source link

Zookeeper should recursively create znodes based on a provided path #1

Open LCVcode opened 3 years ago

LCVcode commented 3 years ago

Some applications, such as bookkeeper, require connected zookeeper servers to have znodes available at specific paths. Zookeeper should be able to automatically create these znodes when a path is provided via relation data.

Znodes can be created manually by accessing a zookeeper-k8s unit, using the zookeeper cli at bin/zkCli.sh, then running the create command followed by a directory. Nested directories must be created one directory at a time, hence using recursion to generate znodes all the way down some path. For example, bookeeper, by default, looks for a znode at /ledgers/available on the zookeeper servers it's connected to. This node is created by, as previously described, accessing the unit, invoking the zookeeper cli, and running create /ledgers followed by create /ledgers/available.

Ideally, this manual step would be completely skipped by having a connecting application, like bookeeeper, provide the path(s) where it will be looking for a znode and having zookeeper create them automatically.