This topic describes how to enable Trino in Ranger and how to configure related permissions.
Prerequisites
A DataLake cluster or a custom cluster of EMR V3.45.0 or a later minor version, or EMR V5.11.0 or a later minor version is created, and the Trino and Ranger services are selected for the cluster. For more information about how to create a cluster, see Create a cluster.
Procedure
- Go to the Services tab.
- Log on to the EMR console. In the left-side navigation pane, click EMR on ECS.
- In the top navigation bar, select the region in which your cluster resides and select a resource group based on your business requirements.
- On the EMR on ECS page, find the desired cluster and click Services in the Actions column.
- Enable Trino in Ranger.
- On the Services tab of the page that appears, click Status in the Ranger-plugin section.
- In the Service Overview section of the Status tab, turn on enableTrino.
- In the Confirm message, click OK.
- Restart Trino.
- On the Services tab, click the icon and select Trino.
- In the upper-right corner, choose .
- In the dialog box that appears, configure the Execution Reason parameter and click OK.
- In the Confirm message, click OK.
Configure permissions
Overview
Before you configure permissions in Ranger, you must access the web UI of Ranger. For more information about how to access the web UI of Ranger, see Overview.
Then, you can click emr-trino in the TRINO section to configure Trino permissions, as shown in the following figure.
On the emr-trino page, you can view the list of all configured policies.
After you enable Trino in Ranger, you must use the trino user to access table data by default.
trino --server master-1-1:9090 --user trino
Note Trino checks the permissions of a user twice. Trino first checks whether the user has access permissions on a catalog and then checks the permissions involved in the current access.
Configuration example
- Access the web UI of Ranger. For more information, see Overview.
- Click emr-trino.
- In the upper-right corner of the page that appears, click Add New Policy.
- Configure the parameters based on your business requirements. The following table describes the parameters.
Parameter Description Policy Name The name of the policy. You can specify a custom name. catalog The catalog. You can select multiple catalogs. schema The schema. You can select multiple schemas. You can set this parameter to an asterisk (*) to specify all schemas. table The table. You can select multiple tables. You can set this parameter to an asterisk (*) to specify all tables. column The column. You can select multiple columns. You can set this parameter to an asterisk (*) to specify all columns. Permissions The permissions that you want to grant. - Click Add.