【问题标题】:Accessing Azure Table storage from Map/Reduce job running in a HDInsight cluster从 HDInsight 群集中运行的 Map/Reduce 作业访问 Azure 表存储
【发布时间】:2014-03-26 03:12:19
【问题描述】:

我们正在一个用 C# 编写的 4 节点 HDInsight 群集上运行 M/R 作业。其中一个 Mapper 类使用 Azure 表存储来应用业务特定规则。

如果没有创建 CloudTable、CloudTableClient 和 CloudStorageAccount 对象,则 M/R 作业可以正常运行。

但是,在为其添加对象引用时,它会出错并且作业执行会停止。部分代码sn-p如下:

public class TopProgMapper : MapperBase
{
    CloudTable table = null;
    CloudStorageAccount storageAccount = null;
    CloudTableClient tableClient = null;

    //The above objects are instantiated and queried in the Mapper ctor

    public TopProgMapper()
    {
        // instantiation code here, which currently has been commented
    }
}

如上所述,即使没有创建对象引用,Mapper 的 ctor 中的代码也已被注释为执行错误。

从 MapReduceResult 对象 (Info.ExitCode) 收到的错误代码为 1,表明 M/R 代码存在问题。但是,其余代码运行得非常好,并且在没有创建上述引用对象时会产生正确的输出。

对此的任何帮助将不胜感激。如果需要,将提供更多详细信息。

感谢和问候, 苏霍

【问题讨论】:

    标签: c# azure mapreduce azure-table-storage azure-hdinsight


    【解决方案1】:

    听起来包含 CoudTable、CloudStorageAccount 和 CloudTableClient 的程序集在运行映射器的集群上不可用。这应该是 Microsoft.WindowsAzure.Storage.dll 或 Microsoft.WindowsAzure.StorageClient.dll,具体取决于您使用的 API 版本。

    尝试在您的配置方法中添加config.FilesToInclude.Add("Microsoft.WindowsAzure.Storage.dll");

    如果这没有帮助,请分享您尝试启动作业时的命令行和输出或代码和异常详细信息。

    【讨论】:

    • 感谢瑞克的回复。我们按照你的建议做了,它奏效了。再次感谢。
    猜你喜欢
    • 1970-01-01
    • 2021-10-22
    • 1970-01-01
    • 2019-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-31
    • 1970-01-01
    相关资源
    最近更新 更多