使用kerberos连接到群集上的HiveMetaStore

时间:2015-10-27 19:49:19

标签: java hadoop hive hcatalog

我有一个java应用程序,它使用hcatalog apis读取hive元数据。如果我需要从具有Kerberos和knox的集群上的配置单元数据库中读取元数据,以下配置是否有效?

HiveConf hcatConf = new HiveConf();
hcatConf.setVar(HiveConf.ConfVars.METASTOREURIS, “thrift://server1.example.com:9083”);
hcatConf.setVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL, “hive/_HOST@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));

HiveConf hcatConf = new HiveConf(); hcatConf.setVar(HiveConf.ConfVars.METASTOREURIS, “thrift://server1.example.com:9083”); hcatConf.setVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL, “hive/_HOST@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)); 我将从远程Windows机器运行Java程序。

如果群集上的hive-site.xml包含以下属性

如何配置HCatClient以连接到配置单元?

0 个答案:

没有答案