如何将 Hive 连接到 asp.net 项目 [英] How to connect Hive to asp.net project

查看:27
本文介绍了如何将 Hive 连接到 asp.net 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Hadoop 很陌生.

Hi I'm very new to Hadoop.

我已将 Microsoft HDInsight 安装到我的本地系统.现在我想连接到 hive 和 HBase 但用于 HIVE 连接我必须指定连接字符串、端口、用户名、密码.

I have installed Microsoft HDInsight to my local system. Now I want to connect to hive and HBase but for HIVE connection I have to specify Connection string, port, username, password.

但我不知道如何获得这个值.我曾尝试使用 localhost 和 8085 作为端口,但这不起作用.我也通过提供本地主机 IP 和我的系统 IP 来完成它.

But I'm not able to figure out how I will get this value. I have tried with localhost and 8085 as a port but this doesn't work. I also done it by giving localhost IP and my system IP too.

请帮忙解决这个问题,让我知道我应该如何进行 HBase 连接

Please help with this and let me know how i should proceed for HBase connectivity

推荐答案

最好的办法可能是使用 Microsoft 的 Hive SDK(也可在 nuget 上作为 Microsoft.Hadoop.Hive 使用)

Your best bet is probably to use Microsoft's Hive SDK (also available on nuget as Microsoft.Hadoop.Hive)

关于如何连接和运行 Linq-to-Hive 查询的一个很好的示例位于http://hadoopsdk.codeplex.com/wikipage?title=Simple%20Linq%20To%20Hive%20Query&referringTitle=LINQ%20to%20Hive

There is a great sample on how to connect and run a Linq-to-Hive query at http://hadoopsdk.codeplex.com/wikipage?title=Simple%20Linq%20To%20Hive%20Query&referringTitle=LINQ%20to%20Hive

这使用了 WebHcat API 将您的查询提交到 Hive,并将针对 Azure 云中的 HDInsights 群集工作(因此需要提供存储密钥以再次获取结果).

This used the WebHcat API to submit your query to Hive, and will work against an HDInsights cluster in the Azure cloud (hence the need to provide a storage key to get the results back again).

如果您只对使用本地副本感兴趣,您可以修改示例以排除存储帐户凭据.

If you're only interested in using the local copy you can adapt the example to exclude the storage account credentials.

var db = new HiveConnection(
            webHCatUri: new Uri("http://localhost:50111"),
            userName: (string) "hadoop", password: (string) null);

var result = db.ExecuteHiveQuery("select * from w3c");
result.Wait();

适用于 HDInsight Preview 的基本安装.

works against a base install of HDInsight Preview.

这篇关于如何将 Hive 连接到 asp.net 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆