'Update a file in zookeeper with zkcli

how do I update a file with zkCli without any third party tools? I can't seem to find any examples anywhere. I can connect to the zookeeper instance, create/delete nodes and etc... but can't figure out how to upload one file from the filesystem into it.

Thanks in advance



Solution 1:[1]

You can't do that with the standard zookeeper cli. You can do that with zk_shell. From their readme,

(CONNECTED) /> cp file:///etc/passwd zk://localhost:2181/passwd

Solution 2:[2]

You can do it with a command like this:

./zkCli.sh set /solr/clusterstate.json "`cat import.json`"

This is run from the Zookeeper bin directory.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Miljen Mikic
Solution 2 user1607158