Hadoop2.x实战:Eclipse本地开发环境搭建与本地运行wordcount实例

本文详细介绍了如何在Windows上使用Eclipse进行Hadoop2.x应用程序的开发,包括环境配置、插件安装、连接参数设置,并通过WordCount实例演示了本地运行过程。在配置过程中,解决了权限、安全模式、SASL认证、winutils.exe缺失和hadoop.dll缺失等常见问题。
摘要由CSDN通过智能技术生成

         林炳文Evankaka原创作品。转载请注明出处http://blog.csdn.net/evankaka

        摘要:本文主要讲了如何在windows上通过eclipse来远程运行hadoop应用程序

hadoop版本:2.7.2

hadoop安装系统:ubuntu14.04

eclipse版本:luna

eclipse安装系统:window64

一、开发环境配置

1、windows下载源码

http://hadoop.apache.org/releases.html 下载源码如下:


解压后放在一个地方:


2、安装hadoop-eclipse-plugin-2.7.2.jar(具体版本视你的hadoop版本而定)

下载地址:http://download.csdn.net/detail/tondayong1981/9432425

 首先把hadoop-eclipse-plugin-2.7.2.jar(具体版本视你的hadoop版本而定)放到eclipse安装目录的plugins文件夹中,如果重新打开eclipse后看到有如下视图,则说明你的hadoop插件已经安装成功了:


其中的“hadoop installation directory”配置项用于指向你的hadoop安装目录(就是上一步的hadoop解压后的目录),在windows下你只需要把下载到的hadoop-2.7.2.tar.gz包解压到某个位置,然后指向这个位置即可。

3、配置连接参数

选择windwos->show view->others

确定后在弹出的窗口中选择map/reduce locations,然后右键New Hadoop location

 配置eclipse中的Map/Reduce Locations,如下图所示

注意,这里的linmaster指代的是linux的地址:

其对应的关系在:C:\Windows\System32\drivers\etc\hosts

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#127.0.0.1       localhost
#10.75.4.22           localhost
10.75.4.25       linmaster


一定在注意,这里的地址一定要和linux上的一样

在ubuntu中输入ifconfig


其中Map/Reduce Master配置和 mapred-site.xml相关(注意linmaster指定IP地址,要在etc/hosts中配置)


DFS master配置和linux上的core-site.xml 相关(注意linmaster指定IP地址,要在etc/hosts中配置)


IP地址和名称映射配置

vi  /etc/hosts 就可以添加 了


上面全部设置好了之后。先启动hadoop。然后在Eclipse资源管理器中,点击DFS Loca

  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值