你的位置:首页 > 软件开发 > ASP.net > C#、JAVA操作Hadoop(HDFS、Map/Reduce)真实过程概述。组件、源码下载。无法解决:Response status code does not indicate success: 500。

C#、JAVA操作Hadoop(HDFS、Map/Reduce)真实过程概述。组件、源码下载。无法解决:Response status code does not indicate success: 500。

发布时间:2016-11-25 13:00:07
一、Hadoop环境配置概述 三台虚拟机,操作系统为:Ubuntu 16.04。 Hadoop版本:2.7.2 NameNode:192.168.72.132 ...

一、Hadoop环境配置概述

      三台虚拟机,操作系统为:Ubuntu 16.04。

      Hadoop版本:2.7.2

      NameNode:192.168.72.132

      DataNode:192.168.72.135,192.168.72.136

      注:具配置过程,不具备介绍了,网上很多。

二、eclipse(JAVA)环境配置概述

     操作系统:Windows 10

     eclipse版本:Mars.2 Release (4.5.2)

     1.hadoop-eclipse-plugin-2.7.2.jar组件放plugins目录 下,具体如何配置去网上找。

     2.配置HADOOP_HOME环境变量:E:\hadoop-2.7.2,配置PATH环境变量,增加:%HADOOP_HOME%\bin

     3.下载:get='_blank'>winutils.exe和Hadoop.dll两个文件,放到E:\hadoop-2.7.2\bin下;Hadoop.dll放到Windows\System32下载。

     4.引用hadoop组件包,为了正确性,share\hadoop\common、share\hadoop\hdfs、share\hadoop\mapreduce、share\hadoop\yarn,以及每个目录下的lib中的jar包全部引用。

     5.新建项目wordcount,网上一大堆代码,直接复制就行了。

     6.支行效果:

C#、JAVA操作Hadoop(HDFS、Map/Reduce)真实过程概述。组件、源码下载。无法解决:Response status code does not indicate success: 500。

三、VS2015(C#)环境配置概述

      1.增加组件引用,分别Install-Package:Microsoft.Azure.Management.HDInsight、Microsoft.Azure.Management.HDInsight.Job 、Microsoft.Hadoop.WebClient、Microsoft.Hadoop.Hive、Microsoft.Hadoop.MapReduce等5个组件,可能会报WebClient和MapReduce引用的版本号不对,删除WebClient组件引用,重新在MapReduce下引用WebClient组件。

      2.配置C:\Windows\System32\drivers\etc\hosts文件,192.168.72.132 wxzz-pc、192.168.72.135 wxzz-pc1、192.168.72.136 wxzz-pc2,否则会报无法连接DataNode。

      3.至此myCluster.StorageSystem.LsFiles和myCluster.StorageSystem.Exists是可以正常执行,myCluster.StorageSystem.CopyFromLocal和myCluster.StorageSystem.CopyToLocal一直出现异常。

      4.后来在NameNode上安装了Hive,myCluster.StorageSystem.CopyFromLocal和myCluster.StorageSystem.CopyToLocal两个操作才可以正常执行。至此,HDFS的操作没有问题了。

      5.myCluster.MapReduceJob.Execute执行mapreduce的时候一直会报无法连接“ip:50111”的异常信息

      6.后来配置hive中的webhcat,并且起动服务,myCluster.MapReduceJob.Execute执行又报“Response status code does not indicate success: 500 (Server Error).”异常信息,堆栈信息如下:

StackTrace	"  在 System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n  在 System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\r\n  在 System.Threading.Tasks.Task.Wait()\r\n  在 Microsoft.Hadoop.WebClient.WebHCatClient.WebHcatMapReduceStreamingExecutor.Execute(Boolean throwOnError)\r\n  在 Microsoft.Hadoop.MapReduce.Execution.Hadoop.StreamingJobExecutorBase.ExecuteCore(Type mapper, Type reducer, Type combiner, HadoopJobConfiguration config)\r\n  在 Microsoft.Hadoop.MapReduce.Execution.Hadoop.StreamingJobExecutorBase.Execute(Type mapperType, Type reducerType, Type combinerType, HadoopJobConfiguration config)\r\n  在 Microsoft.Hadoop.MapReduce.Execution.Hadoop.StreamingJobExecutorBase.Execute[TMapper,TReducer](HadoopJobConfiguration config)\r\n  在 Hadoop_Demo.Program.Main(String[] args) 位置 C:\\Users\\WXZZ\\Desktop\\Hadoop_Demo\\Hadoop_Demo\\Program.cs:行号 61"	string

 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:C#、JAVA操作Hadoop(HDFS、Map/Reduce)真实过程概述。组件、源码下载。无法解决:Response status code does not indicate success: 500。

关键词:C#

C#
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录