This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Page tree
Skip to end of metadata
Go to start of metadata

User Sync Process

Ranger User Sync Process supports reading users and group information from one of the following sources:

    • Unix
    • LADP/AD
    • Text file - CSV or JSON format

This document specifies the details configuring Ranger User Sync process to read users and group information from a text file.


  • Allows the Ranger User Group Sync operation to be done via

    • Command Line operation

    • User Group Sync Property Configuration.

  • Ranger Class

    • org.apache.ranger.unixusersync.process.FileSourceUserGroupBuilder

    • This Class can be run via command line

  • Property File to configure

    In Ranger 0.5 following configuration file is used 

    • /etc/ranger/usersync/conf/ranger-ugsync-site.xml
      Properties to Configure :

      • ranger.usersync.enabled=true
      • ranger.usersync.source.impl.class=org.apache.ranger.unixusersync.process.FileSourceUserGroupBuilder
      • ranger.usersync.filesource.file=/home/admin/ranger-usergroups.txt
      • ranger.usersync.filesource.text.delimiter=,
  • Format Supported

    • JSON

      • JSON file can be given to command line

    • CSV

      • CSV file can be given to command line

    • Delimited File – Configured in ranger-ugsync-site.xml file

      • Other delimiters are supported via User Group Sync Process done via normal Ranger User Group Sync daemon process.

Command Line User Group Sync process

JSON Format

  • If the filename ends with .json, the file content will be treated as JSON with following format:


  "user1":["group-1", "group-2", "group-3"],



  • JSON file format  e.g. UserGroupSyncFile.json







  • To run it as a Command Line tool:

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.json

CSV Format

    • If the filename does not end with .json, each line in the file will be treated as a delimiter separated fields of the following format. Default delimiter is a comma; this can be changed using configuration shown above.



  • CSV File Format e.g. UserGroupSyncFile.txt





  • To run it as Command Line tool:

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





  • No labels


  1. <quote>
    • To run it as Command Line tool:

    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


    Does the user really have choice for classpath and class? Why do you not provide a simple shell script that internally sets the right classpath and class name?

  2. We can provide a  shell script as part of the usersync, but for now this is option to run the FileSourceUserGroupBuilder process

    1. Ramesh Mani, can we create a JIRA to track this? I do like the idea of creating a shell script. Since all the libraries are part of the package, except for the input, I think we can do it easily. Also for the LDAP discovery tool we have a created a shell script to run it. 

      Hopefully, in the future, once we have enough scripts, we consider a CLI where these features could be params.

  3. Bosco, I have created  RANGER-700 - Getting issue details... STATUS  for tracking this request.

  4. FYI The property ranger.usersync.filesource.text.delimiter  is actually ranger.usersync.filesource.text.delimiterer in the code.

    Happy to open a JIRA to change the code to delimiter, but seems easier to update this page rather possibly break anyone already using delimiterer. Let me know.

  5. Bryan Bende, Please open a jira and put the fix in Master.