azure - 将 Hadoop SDK 与本地 HDInsight 服务器结合使用

标签 azure azure-hdinsight

是否可以在本地安装 HDInsight Server 的情况下使用 Hadoop SDK(尤其是 LINQ to Hive)。请注意,我指的不是 Azure 上托管的 HDInsight 服务。

我尝试使用 Microsoft.Hadoop.Hive Nuget 包中的 LINQ to Hive,但无法使其正常工作,因为 LINQ to Hive 似乎要求将结果存储在 Azure Blob 存储中,而不是存储在我的托管实例上。

var hiveConnection = new HiveConnection(new Uri("http://hadoop-poc.cloudapp.net:50111"), "hadoop", "hgfhdfgh", "hadoop", "hadooppartner", "StorageKey");
var metaData = hiveConnection.GetMetaData().Result;
var result = hiveConnection.ExecuteQuery(@"select * from customer limit 1");

即使有存储 key ,我也无法让它工作,因为 MapReduce 作业失败并显示:

AzureException: org.apache.hadoop.fs.azure.AzureException: Container a7e3aa39-75ba-4cc2-a8aa-301257018146 in account hadooppartner not found, and we can't create  it using anoynomous credentials.

我还再次将凭据添加到 core-site.xml 文件中,如下所示:

<property>
   <name>fs.azure.account.key.hadooppartner.blob.core.windows.net</name>
   <value>Credentials</value>
</property>

但是,如果可能的话,我宁愿放弃在 Azure 存储上存储结果。

感谢您的帮助!

最佳答案

您可以使用不带存储帐户选项的 HiveConnection 构造函数来连接到本地安装。这适用于本地机器上默认安装的 HDInsights 开发人员预览版:

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

当然,您也可以将该连接用于任何 LINQ 查询。

关于azure - 将 Hadoop SDK 与本地 HDInsight 服务器结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17448340/

相关文章:

azure - Azure 网站的新部署槽

unit-testing - 使用 HttpRequestMessage 对 Azure Functions 进行单元测试

algorithm - MapReduce计数对的出现

azure - 如何使用附加 Azure Blob 存储上的外部 Metastore 创建/访问 Hive 表?

powershell - 来自 HDInsight 群集的 AzCopy 在 PowerShell 脚本中失败

azure - 使用 PySpark 从 azure blob 存储读取 csv 文件

azure - 如何在零停机的情况下将 Azure Pay 即付即用订阅迁移到 Azure 计划?

Azure DevOps : how configure my pipeline script to trigger another pipeline with different repo?

php - SAS Azure 签名不匹配

azure - 没有足够的核心来在 Azure for Students 上部署资源组错误