【问题标题】:Hadoop in C# - Response status code does not indicate success: 500 (Server Error)C# 中的 Hadoop - 响应状态代码不表示成功:500(服务器错误)
【发布时间】:2014-05-20 17:59:22
【问题描述】:

尝试在 Hadoop 集群上运行 MapReduce 作业时遇到一个奇怪的异常。有趣的是,我可以访问 HDFS,但无法运行作业。

UriBuilder uriBuilder = new UriBuilder("192.168.16.132");
uriBuilder.Port = 8021;//8082;
var hadoop = Hadoop.Connect(uriBuilder.Uri, "username", "password");
hadoop.StorageSystem.MakeDirectory("user/username/test"); //This works
//establish job configuration
HadoopJobConfiguration myConfig = new HadoopJobConfiguration();
myConfig.InputPath = "/user/username/input";
myConfig.OutputFolder = "/user/username/output";
try
{
    //connect to cluster
    MapReduceResult jobResult = hadoop.MapReduceJob.Execute<MySimpleMapper, MySimpleReducer>(myConfig); //This does not work and produces an error: The remote name could not be resolved
    //write job result to console
    int exitCode = jobResult.Info.ExitCode;
    string exitStatus = "Failure";
    if (exitCode == 0) exitStatus = "Success";
        exitStatus = exitCode + " (" + exitStatus + ")";
    Console.WriteLine();
    Console.Write("Exit Code = " + exitStatus);
    Console.Read();
}
catch (Exception exc)
{
    //Error sending request.
}

我正在使用 Hortonworks 沙盒进行测试,如果它有什么不同的话。 确切的错误是:“无法解析远程名称:'sandbox'”。

谁能解释为什么会发生这种情况以及我可以做些什么来解决它?

编辑:我已通过将 Hadoop 集群的 IP 添加到主机文件来解决此问题,但是现在我收到以下异常:“响应状态代码不表示成功:500(服务器错误)。”

【问题讨论】:

  • 你有没有偶然发现它?
  • 我做到了。我将其发布为答案。

标签: c# hadoop mapreduce hdfs hortonworks-data-platform


【解决方案1】:

事实证明,服务器不是在 Windows Azure 上,而是一个 Apache 实现。协议不兼容。两种实现的 HDFS 协议是相同的,所以这可以工作。但是,不支持 Map/Reduce 框架。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-12-30
    • 2018-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多