简体   繁体   English

如何将角色从一个 apache 游侠实例迁移到另一个实例?

[英]How to migrate roles from one apache ranger instance to other instance?

We are planning to make a replica cluster of existing CDP cluster.我们计划制作现有 CDP 集群的副本集群。 I can import/export policies but can not import/export roles.我可以导入/导出策略但不能导入/导出角色。

We have around 2k+ roles, using following api I can create role but wanted to know if this can be automated我们有大约 2k+ 角色,使用以下 api 我可以创建角色但想知道这是否可以自动化

/public/v2/api/roles

Any pointers would be helpful?任何指针都会有帮助吗?

As of now there is no easy our automated way to import/export roles in Ranger-CDP.截至目前,在 Ranger-CDP 中导入/导出角色的自动化方法并不简单。 However, we can automate it using a simple python script.但是,我们可以使用简单的 python 脚本将其自动化。 You can find the script on following url:-您可以在以下 url 找到脚本:-

https://github.com/patilajinkya/ranger_automate/blob/main/roles_exporter.py

Note:- Please read roles_exportes_README.txt before executing the script and let me know if you face any issues.注意:- 请在执行脚本之前阅读roles_exportes_README.txt ,如果您遇到任何问题,请告诉我。 I have tested this on one my test clusters and all looks good.我已经在我的一个测试集群上对此进行了测试,一切看起来都不错。

One thing to keep in mind is, all users and groups from source cluster needs to be available in destination cluster and no duplicate roles should exist in destination cluster.要记住的一件事是,源集群中的所有用户和组都需要在目标集群中可用,并且目标集群中不应存在重复的角色。

If you have any suggestions to improve the script, let me know in the comments.如果您有任何改进脚本的建议,请在评论中告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM