zookeeper zknodes traversal to update acl's

空扰寡人 提交于 2019-12-24 11:08:47

问题


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:


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.



来源:https://stackoverflow.com/questions/41883374/zookeeper-zknodes-traversal-to-update-acls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!