- Home
- Unravel 4.5 Documentation
- Advanced topics
- Configurations
- Connecting to the Hive Metastore
- Obtaining Hive Metastore details
Obtaining Hive Metastore details
This topic explains how to find the connection URL, driver name, username, and password for Hive or HiveServer2. You need these four settings to connect Unravel Server to the Hive Metastore.
For CDH
From CDH version 5.5+, send the Cloudera Manager REST API request
http://
.cloudera-manager-hostname-or-ip
:7180/api/v12/cm/deploymentSearch the JSON response body for
metastore
.Copy the connection URL, driver name, username, and password.
For HDP of MapR
To get the four required settings, contact your cluster's administrator.
For MapR
To get the four required settings, contact your cluster's administrator.
For Azure HDInsight
You can get 3 of the 4 properties from Ambari, or get all 4 from the Azure portal:
Log into the Azure portal.
Click HDInsight clusters, and select your cluster.
In the cluster's Overview window, click the link in the URL field.
This gets you to the Ambari UI.
In Ambari, click Hive | Configs | Advanced.
Get the four required settings:
For connection URL, use the value in the Database URL field.
In the screenshot, this is
jdbc:sqlserver://ldnu62r6x6.database.windows.net;databaseName=v364574cc3cfd51438fb29a723243a9a71bhivemetastore;trustServerCertificate=false;encrypt=true;hostNameInCertificate=*.database.windows.net;
For driver name, use the value in the JDBC Driver Class field.
In the screenshot, this is
com.microsoft.sqlserver.jdbc.SQLServerDriver
For username, use the value in Database Username field.
In the screenshot, this is
v364574cc3cfd51438fb29a723243a9a71bhivemetastoreLogin@ldnu62r6x6.database.windows.net
The password is encrypted; Ambari doesn't show it. Obtain the password from Azure instead.
From the Azure portal, find out the IP address to use for an SSH session to your cluster.
Open an SSH session to that IP address.
In
/etc/hive/conf/hive-site.xml
, search for these values, and copy them to use as-is:javax.jdo.option.ConnectionURL javax.jdo.option.ConnectionDriverName javax.jdo.option.ConnectionUserName To get the Hive password, run this command at the Linux prompt:
sudo java -cp '/var/lib/ambari-agent/cred/lib/*' org.apache.ambari.server.credentialapi.CredentialUtil get javax.jdo.option.ConnectionPassword -provider 'jceks://file/var/lib/ambari-agent/cred/conf/hive_metastore/hive-site.jceks' 2>/dev/null
For Amazon EMR
Open an SSH session to the cluster, open the Hive configuration file, /etc/hive/conf/hive-site.xml
, and search for the four settings. For example, on EMR version 4.7.2, you'd see something like this:
<property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://ip-xx-xx-xx-xx:3306/hive?createDatabaseIfNotExist=true</value> <description>username to use against metastore database</description> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>hive</value> <description>username to use against metastore database</description> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>xxxxxxxxxxx</value> <description>password to use against metastore database</description> </property>