Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to configure HS2 to use external Hive metastore

Highlighted

How to configure HS2 to use external Hive metastore

Expert Contributor

Hi,

I am trying to configure HS2 (lives in HDP) to use external Hive Metastore (outside HDP).

To achieve this, I updated hive.metastore.uri property to point to external hive metastore thrift end-point. But when I am trying to list tables/database via beeline, unable to see tables/dbs which are on external Metastore.

2 REPLIES 2

Re: How to configure HS2 to use external Hive metastore

Master Collaborator

In HDP the recommendation is to use embedded metastore for HiveServer2. That is why Ambari hiveserver2 startup script explicitly passes the following config during startup

/usr/hdp/current/hive-server2/bin/hiveserver2 -hiveconf hive.metastore.uris=" " 

To achieve what you are doing, you will need to manually start the hiveserver2 removing the above parameter in the startup command so that it can use the one you set in hive-site.xml or override the hive.metastore.uris to your external metastore in the startup command. Check out the instructions here.

Highlighted

Re: How to configure HS2 to use external Hive metastore

Rising Star

If you want to force ambari to point HS2 to external metastore, the update the following templates on the node where HS2 is running:

/var/lib/ambari-server/resources/common-services/HIVE/0.12.0.2.0/package/templates/startHiveserver2.sh.j2 

You can either clear the cache or update the template in:

/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/templates/startHiveserver2.sh.j2

- Restart HS2 to point to the external metastore. Just FYI ... the recommended approach is to use the embedded metastore as per this KB Article.

Don't have an account?
Coming from Hortonworks? Activate your account here