如何使用C#连接到HBase / Hadoop数据库 [英] how to connect to HBase / Hadoop Database using C#

查看:1112
本文介绍了如何使用C#连接到HBase / Hadoop数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,探索微软HDInsight Hadoop for Windows.But不知道从哪里开始,并开始使用Apache Hadoop与C#/ ASP.NET MVC。



我知道 http://hadoopsdk.codeplex.com/ 是最佳可用资源,但无法找到文档白手起家?比如创建集群,数据库,然后将它连接到C#应用程序。 解决方案

最简单的入门方法是使用 Azure上的HDInsight服务(目前仍在预览中,但效果很好)。这样,您就可以登录到您的天蓝色门户并启动一个集群,并将其链接到您的天蓝色存储。



如果您真的不想去云,那么您可以通过网络平台安装程序下载HDInsight开发人员预览软件包,这将创建一个单节点本地集群。另外,如果你对'只是hadoop'感兴趣,那么你可以尝试使用Hortonworks或Cloudera提供的虚拟机。

之后,如果您熟悉SQL,则可能需要从Hive开始。 O'Reilly Hadoop权威指南非常好。

从.NET的角度来看,codeplex上的 hadoopsdk 是一个好的地方开始。

就非常基本的连接示例而言,尝试这个博客为例子,但请注意HDInsight的连接略有不同,现在它全部使用了templeton界面,所以这会让你继续:

  var db = new HiveConnection(
webHCatUri:new Uri(http:// localhost:50111),
userName:(string)hadoop,password:(string)null);
var result = db.ExecuteHiveQuery(select * from w3c);

如果您希望在HDInsight上完成MapReduce,那么您可能需要查看在codeplex上使用sdk的C#MapReduce示例。



请注意,默认的HDInsight安装还附带了一些很好的示例,其中包括一些可用的数据和一些PowerShell脚本和.NET代码让你开始。



享受!

Recently, Exploring Microsoft HDInsight Hadoop for Windows.But don't know where to began and start using apache hadoop with c# / asp.net mvc.

i know http://hadoopsdk.codeplex.com/ is best available resource to start, but can't find documentation to start from scratch? like creating cluster,database and then connecting it to C# app.

解决方案

The easiest way to get started is to use the HDInsight service on Azure (which is still in preview, but works well). That way you can just log into your azure portal and spin up a cluster, which will be linked to your azure storage.

If you really don't want to go to the cloud, then you can download the HDInsight developer preview package through the web platform installer, which will create a single node local cluster. Alternatively, if you're interested in 'just hadoop' then you could try using the VMs provided by Hortonworks or Cloudera.

After that, it's probably worth starting with Hive if you are familiar with SQL. The O'Reilly Definitive Guide to Hadoop is pretty good on that.

From the .NET point of view, the hadoopsdk on codeplex is a good place to start.

As far as very basic connection examples go, try this blog for an example, but note that the connection for HDInsight is slightly different now it's all using the templeton interface, so this will get you going:

var db = new HiveConnection(
        webHCatUri: new Uri("http://localhost:50111"),
        userName: (string) "hadoop", password: (string) null);
var result = db.ExecuteHiveQuery("select * from w3c");

If you are looking to do full on MapReduce on HDInsight, then you probably want to take a look at the C# MapReduce examples with the sdk on codeplex.

Note that the default HDInsight install also comes with some good samples, which include a bit of data to play with and some powershell scripts and .NET code to get you started.

Enjoy!

这篇关于如何使用C#连接到HBase / Hadoop数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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