The Sentry Service
The Sentry service is a RPC server that stores the authorization metadata in an underlying relational database and provides RPC interfaces to retrieve and manipulate privileges. It supports secure access to services using Kerberos. The service serves authorization metadata from the database backed storage; it does not handle actual privilege validation. The Hive and Impala services are clients of this service and will enforce Sentry privileges when configured to use Sentry.
For more details on the new privilege model and Grant/Revoke syntax to modify privileges, see Sentry Service Configuration.
Prerequisites
- CDH 5.1.x managed by Cloudera Manager 5.1.x. See the Cloudera Manager Administration Guide and the CDH 5 Installation Guide for instructions.
- Impala 1.4.0.
- HiveServer2 running with strong authentication (Kerberos or LDAP).
- Implement Kerberos authentication on your cluster. For instructions on how to enable Kerberos on your cluster, see Enabling Kerberos Authentication Using Cloudera Manager.
Adding the Sentry Service
- On the Home page, click to the right of the cluster name and select Add a Service. A list of service types display. You can add one type of service at a time.
- Select the Sentry service and click Continue.
- Select the radio button next to the services on which the new service should depend and click Continue.
- Customize the assignment of role instances to
hosts. The wizard evaluates the hardware configurations of the hosts to determine the best
hosts for each role. These assignments are typically acceptable, but you can reassign role
instances to hosts of your choosing, if desired.
Click a field below a role to display a dialog containing a pageable list of hosts. If you click a field containing multiple hosts, you can also select All Hosts to assign the role to all hosts or Custom to display the pageable hosts dialog.
The following shortcuts for specifying host names are supported:- Range of hostnames (without the domain portion)
Range Definition Matching Hosts 10.1.1.[1-4] 10.1.1.1, 10.1.1.2, 10.1.1.3, 10.1.1.4 host[1-3].company.com host1.company.com, host2.company.com, host3.company.com host[07-10].company.com host07.company.com, host08.company.com, host09.company.com, host10.company.com - IP addresses
- Rack name
Click the View By Host button for an overview of the role assignment by host ranges.
- Range of hostnames (without the domain portion)
- Configure database settings:
- Choose the database type:
- Leave the default setting of Use Embedded Database to have Cloudera Manager create and configure required databases. Make a note of the auto-generated passwords.
- Select Use
Custom Databases to specify external databases.
- Enter the database host, database type, database name, username, and password for the database that you created when you set up the database.
- Click Test Connection to confirm that Cloudera Manager can communicate with the database using the information you have supplied. If the test succeeds in all cases, click Continue; otherwise check and correct the information you have provided for the database and then try the test again. (For some servers, if you are using the embedded database, you will see a message saying the database will be created at a later step in the installation process.) The Review Changes page displays.
- Choose the database type:
- Click Continue to start the service.
- Click Continue then click Finish. You are returned to the Home page.
- Verify the new service is started properly by checking the health status for the new service. If the Health Status is Good, then the service started properly.
- To begin using the Sentry service, see Enabling the Sentry Service for Hive and Enabling the Sentry Service for Impala.
- Use the command-line interface Beeline to issue grants to the Sentry service to match the contents of your old policy file(s). For more details on the Sentry service and examples on using Grant/Revoke statements to match your policy file, see Sentry Service Configuration.
Migrating to the Sentry Service
The following steps describe how you can upgrade from Sentry's policy file-based approach to the new database-backed Sentry service.
- If you haven't already done so, upgrade your cluster to CDH 5.1.x and Cloudera Manager 5.1.x. Refer the Cloudera Manager Administration Guide for instructions.
- Disable the existing Sentry policy file for any Hive or Impala
services on the cluster. To do this:
- Navigate to the Hive or Impala service.
- Click the Configuration tab.
- Under the Enable Sentry Authorization using Policy Files checkbox. Cloudera Manager will throw a validation error if you attempt to configure the Sentry service while this property is checked. category, uncheck the
- Repeat for any remaining Hive or Impala services.
- Add the new Sentry service to your cluster. For instructions, see Adding the Sentry Service.
- To begin using the Sentry service, see Enabling the Sentry Service for Hive and Enabling the Sentry Service for Impala.
- Use the command-line interface Beeline to issue grants to the Sentry service to match the contents of your old policy file(s). For more details on the Sentry service and examples on using Grant/Revoke statements to match your policy file, see Sentry Service Configuration.
Enabling the Sentry Service for Hive
Before you begin:
- Ensure all the action items under Prerequisites are complete.
- The Hive warehouse directory (/user/hive/warehouse or the path you have specified as hive.metastore.warehouse.dir in your Hive configuration) must be owned by the hive user and group.
- Permissions on the Hive warehouse directory and all subdirectories must
be 771. All files and directories should be owned by hive:hive. For
example:
$ sudo -u hdfs hdfs dfs -chmod -R 771 /user/hive/warehouse $ sudo -u hdfs hdfs dfs -chown -R hive:hive /user/hive/warehouse
- Disable impersonation for HiveServer2 in the Cloudera
Manager Admin Console:
- Go to the Hive service.
- Click the Configuration tab.
- Under the HiveServer2 role group, uncheck the HiveServer2 Enable Impersonation property, and click Save Changes.
- To enable the Hive user to submit MapReduce jobs, under
TaskTracker role group(s) set the Minimum User ID for Job Submission to 0. You
must do this for every TaskTracker role group
for the MapReduce service that is associated with Hive, if more than one exists.
- Go to the MapReduce service.
- Click the Configuration tab.
- Under a TaskTracker role group go to the Security category.
- Set the Minimum User ID for Job Submission property to zero (the default is 1000) and click Save Changes.
- Restart the MapReduce service.
- To enable the Hive user to submit YARN jobs, ensure the Allowed System Users property includes the
hive user. You must do this
for every NodeManager role group for the YARN
service that is associated with Hive, if more than one exists.
- Go to the YARN service.
- Click the Configuration tab.
- Under a NodeManager role group go to the Security category.
- Ensure the Allowed System Users property includes the hive user. If not, add hive and click Save Changes.
- Restart the YARN service.
To enable the Sentry service for Hive:
- Go to the Hive service.
- Click the Configuration tab.
- In the Service-Wide category, set the Sentry Service property to Sentry.
- Restart the Hive service.
For instructions on enabling the Sentry service for Impala, see Enabling the Sentry Service for Impala.
<< The Oozie Service | The Solr Service >> | |