*       If my hive-site.xml contains the following properties
< property>
<name>hive.metastore.uris</name>
<value>thrift://server1.example.com:9083</value>
</property>

<property>
<name>hive.metastore.sasl.enabled</name>
<value>true</value>
<description>If true, the metastore thrift interface will be secured with SASL. 
Clients must authenticate with Kerberos.</description>
< /property>

<property>
<name>hive.metastore.kerberos.keytab.file</name>
<value>/etc/hive/conf/hive.keytab</value>
<description>The path to the Kerberos Keytab file containing the metastore 
thrift server’s service principal.</description>
< /property>

<property>
<name>hive.metastore.kerberos.principal</name>
<value>hive/_h...@example.com</value>
<description>The service principal for the metastore thrift server. The special 
string _HOST will be replaced automatically with the correct host 
name.</description>
< /property>

how do I configure the HCatClient to connect to hive?

Thanks

Rachna

 

 

From: Rachna Jotwani Bakhru [mailto:rjotw...@dag.com] 
Sent: Thursday, October 15, 2015 6:25 PM
To: user@hive.apache.org
Subject: Hcatalog api - kerberos and knox

 

I have a java application which reads hive metadata using hcatalog apis. If I 
need to read metadata from a hive database on a cluster with Kerberos and knox, 
would the following configuration work?
HiveConf hcatConf = new HiveConf();
hcatConf.setVar(HiveConf.ConfVars.METASTOREURIS, 
“thrift://server1.example.com:9083”);
hcatConf.setVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL, 
“hive/_h...@example.com <mailto:hive/_h...@example.com> ”);
hcatConf.setVar(HiveConf.ConfVars.METASTORE_KERBEROS_KEYTAB_FILE, 
“<local_path>/hive.keytab”);
hcatConf.setVar(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL, “true”);

HCatClient  hcatClient = HCatClient.create(new Configuration(hcatConf));
I will be running the Java program from a remote windows machine.

 

Reply via email to