Support Questions

Find answers, ask questions, and share your expertise

Ranger API Synchronous

avatar
Expert Contributor

I am using the importPoliciesFromFile API call but see it deletes and creates the policies. Will this cause any impact on authorization if someone hits the api at the same time or is this API synchronous?

 

By synchronous I mean, does it stop all other code execution and user interaction until the call returns?

1 ACCEPTED SOLUTION

avatar
Master Mentor

@drewski7 
Ranger plugins that use Ranger as an authorization module will cache local policy and use the same for authorization purposes
Ranger plugins cache the tags and periodically poll the tag store for any changes. When a change is detected, the plugins update the cache. In addition, the plugins store the tag details in a local cache file – just as the policies are stored in a local cache file. When the component restarts, the plugins will use the tag data from the local cache file if the tag store is not reachable.

  1. At periodic intervals , a plugin polls the Ranger Admin to retrieve the updated version of policies. The policies are cached locally by the plugin and used for access control
  2. The Policy evaluation and policy enforcement happens within the service process.
    1. The heart of this processing is the “Policy Engine”.
    2. It uses a memory resident-cached set of policies.

Ranger takes 30secs to refresh policies check the "Plugin" option in the ranger UI  but you can change the refresh time 

In Ambari UI->HDFS->Services->Configs->"Advance ranger-hdfs-security" you can change the poll interval here[refresh time].

Geoffrey

 

View solution in original post

1 REPLY 1

avatar
Master Mentor

@drewski7 
Ranger plugins that use Ranger as an authorization module will cache local policy and use the same for authorization purposes
Ranger plugins cache the tags and periodically poll the tag store for any changes. When a change is detected, the plugins update the cache. In addition, the plugins store the tag details in a local cache file – just as the policies are stored in a local cache file. When the component restarts, the plugins will use the tag data from the local cache file if the tag store is not reachable.

  1. At periodic intervals , a plugin polls the Ranger Admin to retrieve the updated version of policies. The policies are cached locally by the plugin and used for access control
  2. The Policy evaluation and policy enforcement happens within the service process.
    1. The heart of this processing is the “Policy Engine”.
    2. It uses a memory resident-cached set of policies.

Ranger takes 30secs to refresh policies check the "Plugin" option in the ranger UI  but you can change the refresh time 

In Ambari UI->HDFS->Services->Configs->"Advance ranger-hdfs-security" you can change the poll interval here[refresh time].

Geoffrey