Microsoft Windows Azure存储:远程服务器返回错误404未找到

时间:2016-09-09 20:55:48

标签: azure mapreduce cloud hdinsight bigdata

我经常收到错误" 404找不到"。

我已经创建了集群和存储帐户以及容器。

我得到的详细错误是:

  

未处理的异常:System.AggregateException:发生了一个或多个错误。 ---
  Microsoft.WindowsAzure.Storage.StorageException:远程服务器返回错误:(404)Not Found。

     

System.Net.WebException:远程服务器返回错误:(404)Not Found。

这是我的代码:

public static void ConnectToAzureCloudServer()
{
    HadoopJobConfiguration myConfig = new HadoopJobConfiguration();
    myConfig.DeleteOutputFolder = true;
    myConfig.InputPath = "wasb://hdstore12345687@hdstore12345678.blob.core.windows.net/example/data/gutenberg/";
    myConfig.OutputFolder = "wasb://hdstore12345687@hdstore12345678.blob.core.windows.net/out/o";

    Environment.SetEnvironmentVariable("HADOOP_HOME", @"C:\apps\dist\hadoop-2.7.1.2.3.3.1-25\bin");
    Environment.SetEnvironmentVariable("JAVA_HOME", @"C:\Program Files\Java\jre1.8.0_101\bin\javaw.exe");

    Uri azureCluster = new Uri("https://HDInsight-My-Demo.azurehdinsight.net");
    string clusterUserName = "hduser";
    string clusterPassword = "Hdinsight@1234";

    // This is the name of the account under which Hadoop will execute jobs.
    // Normally this is just "Hadoop".
    string hadoopUserName = "Hadoop";

    // Azure Storage Information.
    string azureStorageAccount = "hdstore12345678.blob.core.windows.net";
    string azureStorageKey = @"blablabalbNQNUqtSOMEStorGEKeyssbhIvFjfHTg==";
    string azureStorageContainer = "hdstore12345687";

    //string azureStorageContainer = "https://hdstore12345678.blob.core.windows.net/hdstore12345678";

    bool createContinerIfNotExist = true;

    Microsoft.Hadoop.MapReduce.IHadoop myCluster = Microsoft.Hadoop.MapReduce.Hadoop.Connect(azureCluster, clusterUserName, hadoopUserName, clusterPassword, azureStorageAccount, azureStorageKey, azureStorageContainer, createContainerIfNotExist);

    //execute mapreduce job
    MapReduceResult jobResult = myCluster.MapReduceJob.Execute<MySimpleMapper, MySimpleReducer>(myConfig);

    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();
}

我用user / out创建了一个输出文件夹。我是HadoopJobconfiguration我将它设置为true并将其删除!!这意味着它能够找到存储空间。那为什么我会得到那个错误。

enter image description here

0 个答案:

没有答案