Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
25 KiB
Adding a Ranger Access Permission Policy for HDFS
Scenario
The Ranger administrator can use Ranger to configure the read, write, and execution permissions on HDFS directories or files for HDFS users.
Prerequisites
- The Ranger service has been installed and is running properly.
- You have created users, user groups, or roles for which you want to configure permissions.
Procedure
- Log in to the Ranger management page.
- On the homepage, click the component plug-in name in the HDFS area, for example, hacluster.
- Click Add New Policy to add an HDFS permission control policy.
- Configure the parameters listed in the table below based on the service demands.
For example, to add the write permission for the /user/test directory of user testuser, the configuration is as follows:
Table 2 Setting permissions Task
Role Authorization
Setting the HDFS administrator permission
Setting the permission for users to check and recover HDFS
- Add a folder or a file path in Resource Path.
- In the Allow Conditions area, select a user from the Select User drop-down list.
- Click Add Permissions and select Read and Execute.
Setting the permission for users to read directories or files of other users
- Add a folder or a file path in Resource Path.
- In the Allow Conditions area, select a user from the Select User drop-down list.
- Click Add Permissions and select Read and Execute.
Setting the permission for users to write data to files of other users
- Add a folder or a file path in Resource Path.
- In the Allow Conditions area, select a user from the Select User drop-down list.
- Click Add Permissions and select Write and Execute.
Setting the permission for users to create or delete sub-files or sub-directories in the directory of other users
- Add a folder or a file path in Resource Path.
- In the Allow Conditions area, select a user from the Select User drop-down list.
- Click Add Permissions and select Write and Execute.
Setting the permission for users to execute directories or files of other users
- Add a folder or a file path in Resource Path.
- In the Allow Conditions area, select a user from the Select User drop-down list.
- Click Add Permissions and select Execute.
Setting the permission for allowing subdirectories to inherit all permissions of their parent directories
- Add a folder or a file path in Resource Path.
- Enable the recursion function. Recursive indicates that recursion is enabled.
- (Optional) Add the validity period of the policy. Click Add Validity period in the upper right corner of the page, set Start Time and End Time, and select Time Zone. Click Save. To add multiple policy validity periods, click
. To delete a policy validity period, click
.
- Click Add to view the basic information about the policy in the policy list. After the policy takes effect, check whether the related permissions are normal.
To disable a policy, click
to edit the policy and set the policy to Disabled.