zookeeper zknodes traversal to update acl's

2019-07-25 02:55发布

Currently, I have zknodes with ACL property world:anyone:crdwa. With new requirement, I need to update ACL to use auth scheme. For that, I need to update all current zknodes with auth scheme ACL too. I am planning to write a python script and do DFS traversal doing so. I want to reach out to learn, if there is an open source library or better way to achieve the same?

1条回答
仙女界的扛把子
2楼-- · 2019-07-25 03:14

Scripting the traversal in Python (or any language of choice) is a viable solution.

Current releases of Apache ZooKeeper at the time of this writing do not provide any built-in capabilities for recursive traversal of the znode hierarchy. Apache JIRA Issue ZOOKEEPER-1962 tracks development of a zkCli ls -R command capable of doing a recursive listing. This is scheduled to ship in Apache ZooKeeper 3.5.3. If you wanted a solution in Java, you could adapt the code from that patch or even apply the patch and make your own custom ZooKeeper build so that you can use the new zkCli feature.

I recommend reading the discussion on that JIRA and the patch even if you decide to write your own implementation. Before we committed the patch, there was some discussion of a few edge cases that are worth considering.

查看更多
登录 后发表回答