Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to configure Ranger Usersync to sync users from a file

Solved Go to solution

How to configure Ranger Usersync to sync users from a file

 
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to configure Ranger Usersync to sync users from a file

Expert Contributor
4 REPLIES 4

Re: How to configure Ranger Usersync to sync users from a file

Set the following properties in usersync :

usergroupSync.source.impl.class = org.apache.ranger.unixusersync.process.FileSourceUserGroupBuilder

usergroupSync.filesource.file =C:\\tmp\userSource1.json

usergroupSync.filesource.text.delimiter = , Example file: Multiple Users

{

"user1001": [

"group0",

"group18",

"group6",

"group7",

"group26",

"group24",

"group19",

"group3",

"group5"

],

"user2001": [

"group0",

"group18",

"group6"

]

}

Re: How to configure Ranger Usersync to sync users from a file

Another approach:

Create a text file containing user/group details in the following format:

        - one line for each user

        - each line consists of multiple fields, separated by a comma

        - the first field is the username and every field after that is a group name the user belongs to

        - example line: user1,group1, group2,group3

  Load the user/group information in the text file, say at /home/user/ranger-users.txt, with the following command line:

  java -cp "/usr/hdp/current/ranger-usersync/dist/unixusersync-0.4.0.2.2.0.14-2.jar:/usr/hdp/current/ranger-usersync/lib/*:/etc/ranger/usersync/conf" com.xasecure.unixusersync.process.FileSourceUserGroupBuilder /home/user/ranger-users.txt
Updated for Ranger 0.50
java -Dlogdir=/var/log/ranger/usersync -cp "/usr/hdp/current/ranger-usersync/dist/*:/usr/hdp/current/ranger-usersync/lib/*:/usr/hdp/current/ranger-usersync/conf" org.apache.ranger.unixusersync.process.FileSourceUserGroupBuilder /tmp/UserGroupSyncFile.txt

Re: How to configure Ranger Usersync to sync users from a file

Expert Contributor

Re: How to configure Ranger Usersync to sync users from a file

Thanks for creating the wiki for this

Don't have an account?
Coming from Hortonworks? Activate your account here