Using Apache Hive with HBase in CDH

You need to associate the HBase service with the Hive service, so Hive scripts can use HBase as described in the procedure below.

Prerequisites for Using Hive with HBase

  • Using Cloudera Manager, install CDH with HBase using Cloudera Manager. Add the Hive service, and set up the cluster.
  • If Kerberos is enabled, assign the following roles to the gateway node:
    • Hive Gateway Role
    • HDFS Gateway Role
    • HBase Gateway Role
  • If Kerberos is not enabled, assign the following roles to the gateway node:
    • Hive Gateway Role
    • HDFS Gateway Role

Associate HBase with Hive

  1. In a Sentry-controlled environment, grant the hive user most privileges in HBase.
    grant 'hive', 'RWXC' 
  2. From the Cloudera Manager home page, click the Hive service.
  3. On the Hive service page, select the Configuration tab.
  4. On the Hive service Configuration page, type hbase into the search text box.
  5. Locate the HBase Service configuration property on the page, select the HBase instance that you want to associate with Hive, and click Save Changes.
  6. Redeploy the client configuration for the Hive service and restart all stale services.

The HBase service is now associated with the Hive service, and your Hive scripts can use HBase.