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 hbase.security.authentication=kerberos -hiveconf hbase.rpc.engine=org.apache.hadoop.hbase.ipc.SecureRpcEngine -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 Region Server 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:
In the following, _HOST is the host name of the HBase Region Server that the application is connecting to:
You can also set the HIVE_OPTS environment variable in your shell profile.
|<< Hive Metastore Server Security Configuration||HCatalog Security Configuration >>|