简体   繁体   中英

How to migrate roles from one apache ranger instance to other instance?

We are planning to make a replica cluster of existing CDP cluster. 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

/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. However, we can automate it using a simple python script. You can find the script on following 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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