Configure Hive to use with HBase

To use Hive with HBase, you must add the required JAR path to the Hive configuration using Cloudera Manager.

  • SSH into your HBase cluster, and run the hbase mapredcp command to get a list of JARs required to configure HBase Hive integration.
  • Download the client configuration from Cloudera Manager > Actions > Download Client Configuration. You need the hbase-site.xml file contents to complete this configuration.
  1. Go to Cloudera Manager.
  2. Go to the Hive service.
  3. Click the Configuration tab.
  4. Select Scope > Hive (Service Wide).
  5. Use the Search box to search or find the Hive Service Advanced Configuration Snippet (Safety Valve) for hive-site.xml property and edit the value to add these properties:
    <property>
    <name>hive.aux.jars.path</name>
    <value>
    [***LIST OF JAR FILE PATHS***]
    </value>
    </property>
     
    <property>
    [***hbase-site.xml properties***]
    </property>
    
    For example
    <!--Hive aux jar path properties-->
    <property>
        <name>hive.aux.jars.path</name>
        <value>
        /opt/cloudera/parcels/CDH-7.2.8-1.cdh7.2.8.p0.12189158/lib/hbase/bin/../lib/shaded-clients/
        hbase-shaded-mapreduce-2.2.6.7.2.8.0-181.jar,
    .....,
    .....,
        /opt/cloudera/parcels/CDH-7.2.8-1.cdh7.2.8.p0.12189158/lib/hbase/bin/../lib/
        client-facing-thirdparty/slf4j-api-1.7.30.jar
        </value>
    </property>
    
    
    <!--hbase-site.xml properties-->
    <property>
        <name>hbase.rootdir</name>  
        <value>hdfs://root-directory:8020/hbase</value>
    </property>
    <property>
        <name>hbase.replication</name>
        <value>true</value>
    </property>
    <property>
        <name>hbase.client.write.buffer</name>
        <value>2097152</value>
    </property>
    <property>
        <name>hbase.client.pause</name>
        <value>100</value>
    .....
    .....
    </property>
    
  6. Click Save Changes.
  7. Restart the Hive service.