hadoop搭建与eclipse开发环境设置
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
hadoop搭建与eclipse开发环境设置
――罗利辉
1.前言
1.1 目标
目的很简单,为进行研究与学习,部署一个hadoop运行环境,并搭建一个hadoop开发与测试环境。
具体目标是:
✓在ubuntu系统上部署hadoop
✓在windows 上能够使用eclipse连接ubuntu系统上部署的hadoop进行开发与测试1.2 软硬件要求
注意:
Hadoop版本和Eclipse版本请严格按照要求。
现在的hadoop最新版本是hadoop-0.20.203,我在windows上使用eclipse(包括3.6版本和3.3.2版本)连接ubuntu上的hadoop-0.20.203环境一直没有成功。但是开发测试程序是没有问题的,不过需要注意权限问题。
如果要减少权限问题的发生,可以这样做:ubuntu上运行hadoop的用户与windows 上的用户一样。
1.3 环境拓扑图
ubuntu 192.168.69.231
ubuntu2
192.168.69.233 ubuntu1
192.168.69.232
2.Ubuntu 安装
安装ubuntu11.04 server系统,具体略。
我是先在虚拟机上安装一个操作系统,然后把hadoop也安装配置好了,再克隆二份,然后把主机名与IP修改,再进行主机之间的SSH配置。
如果仅作为hadoop的运行与开发环境,不需要安装太多的系统与网络服务,或者在需要的时候通过apt-get install进行安装。不过SSH服务是必须的。
3.Hadoop 安装
以下的hadoop安装以主机ubuntu下进行安装为例。
3.1 下载安装jdk1.6
安装版本是:jdk-6u26-linux-i586.bin,我把它安装拷贝到:/opt/jdk1.6.0_26
3.2 下载解压hadoop
安装包是:hadoop-0.20.2.tar.gz。
3.3 修改系统环境配置文件
切换为根用户。
●修改地址解析文件/etc/hosts,加入
3.4 修改hadoop的配置文件
切换为hadoop用户。
●修改hadoop目录下的conf/hadoop-env.sh文件
加入java的安装根路径:
●把hadoop目录下的conf/core-site.xml文件修改成如下:
●把hadoop目录下的conf/ hdfs-site.xml文件修改成如下:
●把hadoop目录下的conf/ mapred-site.xml文件修改成如下: