Using Hive to Run Queries on a Secure HBase Server

To use Hive to run queries on a secure HBase Server, you must set the following HIVE_OPTS environment variable:

env HIVE_OPTS="-hiveconf -hiveconf hbase.master.kerberos.principal=hbase/_HOST@YOUR-REALM.COM -hiveconf hbase.regionserver.kerberos.principal=hbase/_HOST@YOUR-REALM.COM -hiveconf hbase.zookeeper.quorum=zookeeper1,zookeeper2,zookeeper3" hive


  • You replace YOUR-REALM with the name of your Kerberos realm
  • You replace zookeeper1,zookeeper2,zookeeper3 with the names of your ZooKeeper servers. The hbase.zookeeper.quorum property is configured in the hbase-site.xml file.
  • The special string _HOST is replaced at run-time by the fully-qualified domain name of the host machine where the HBase Master or RegionServer is running. This requires that reverse DNS is properly working on all the hosts configured this way.

In the following, _HOST is the name of the host where the HBase Master is running:

-hiveconf hbase.master.kerberos.principal=hbase/_HOST@YOUR-REALM.COM

In the following, _HOST is the hostname of the HBase RegionServer that the application is connecting to:

-hiveconf hbase.regionserver.kerberos.principal=hbase/_HOST@YOUR-REALM.COM