Eclipse-Hadoop开发配置详解
Eclipse_Hadoop开发详解
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0 }
body { font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; line-height: 1.6; color: rgba(51, 51, 51, 1); background-color: rgba(255, 255, 255, 1); padding: 20px; max-width: 960px; margin: 0 auto }
body>*:first-child { margin-top: 0 !important }
body>*:last-child { margin-bottom: 0 !important }
p, blockquote, ul, ol, dl, table, pre { margin: 15px 0 }
h1, h2, h3, h4, h5, h6 { margin: 20px 0 10px; padding: 0; font-weight: bold; -webkit-font-smoothing: antialiased }
h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code { font-size: inherit }
h1 { font-size: 28px; color: rgba(0, 0, 0, 1) }
h2 { font-size: 24px; border-bottom: 1px solid rgba(204, 204, 204, 1); color: rgba(0, 0, 0, 1) }
h3 { font-size: 18px }
h4 { font-size: 16px }
h5 { font-size: 14px }
h6 { color: rgba(119, 119, 119, 1); font-size: 14px }
body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child { margin-top: 0; padding-top: 0 }
a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { margin-top: 0; padding-top: 0 }
h1+p, h2+p, h3+p, h4+p, h5+p, h6+p { margin-top: 10px }
a { color: rgba(65, 131, 196, 1); text-decoration: none }
a:hover { text-decoration: underline }
ul, ol { padding-left: 30px }
ul li>:first-child, ol li>:first-child, ul li ul:first-of-type, ol li ol:first-of-type, ul li ol:first-of-type, ol li ul:first-of-type { margin-top: 0 }
ul ul, ul ol, ol ol, ol ul { margin-bottom: 0 }
dl { padding: 0 }
dl dt { font-size: 14px; font-weight: bold; font-style: italic; padding: 0; margin: 15px 0 5px }
dl dt:first-child { padding: 0 }
dl dt>:first-child { margin-top: 0 }
dl dt>:last-child { margin-bottom: 0 }
dl dd { margin: 0 0 15px; padding: 0 15px }
dl dd>:first-child { margin-top: 0 }
dl dd>:last-child { margin-bottom: 0 }
pre, code, tt { font-size: 12px; font-family: Consolas, "Liberation Mono", Courier, monospace }
code, tt { margin: 0; padding: 0; white-space: nowrap; border: 1px solid rgba(234, 234, 234, 1); background-color: rgba(248, 248, 248, 1); border-radius: 3px }
pre>code { margin: 0; padding: 0; white-space: pre; border: none; background: rgba(0, 0, 0, 0) }
pre { background-color: rgba(248, 248, 248, 1); border: 1px solid rgba(204, 204, 204, 1); font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-radius: 3px }
pre code, pre tt { background-color: rgba(0, 0, 0, 0); border: none }
kbd { -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; background-color: rgba(221, 221, 221, 1); background-image: linear-gradient(rgba(241, 241, 241, 1), rgba(221, 221, 221, 1)); background-repeat: repeat-x; border-top: 1px solid rgba(221, 221, 221, 1); border-right: 1px solid rgba(204, 204, 204, 1); border-bottom: 1px solid rgba(204, 204, 204, 1); border-left: 1px solid rgba(221, 221, 221, 1); border-image: none; border-radius: 2px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; line-height: 10px; padding: 1px 4px }
blockquote { border-left: 4px solid rgba(221, 221, 221, 1); padding: 0 15px; color: rgba(119, 119, 119, 1) }
blockquote>:first-child { margin-top: 0 }
blockquote>:last-child { margin-bottom: 0 }
hr { clear: both; margin: 15px 0; height: 0; overflow: hidden; border-top: none; border-right: none; border-bottom: 4px solid rgba(221, 221, 221, 1); border-left: none; background: rgba(0, 0, 0, 0); padding: 0 }
table th { font-weight: bold }
table th, table td { border: 1px solid rgba(204, 204, 204, 1); padding: 6px 13px }
table tr { border-top: 1px solid rgba(204, 204, 204, 1); background-color: rgba(255, 255, 255, 1) }
table tr:nth-child(2n) { background-color: rgba(248, 248, 248, 1) }
img { max-width: 100% }
Eclipse-Hadoop开发配置详解
前提概要 主要是针对Hadoop-Eclipse开发环境过程中遇到的配置问题汇总.本文汇总的信息主要是对Hadoop-2.2.0版本的Eclipse的开发安装配置。本地开发环境是Win7(64-bit)+Eclipse(Kepler Service Release 2 64-bit)、win7(64位)、jdk(1.6.0_31 64-bit)、开发连接的服务器是CentOS Linux release 7.2.1511 (Core)。
环境准备
- CentOs (
CentOS Linux release 7) - JDK (
1.6.0_31 64-bit) - Eclipse (
Kepler Service Release 2)+Hadoop插件 - Hadoop-2.2.0
- Win7 (
64-bit)
Eclipse插件的安装与配置
安装Eclipse插件和设置hadoop-2.2.0文件包的位置。
- Eclipse(
Kepler Service Release 2)解压后,将hadoop-eclipse-plugin-2.6.0.jar包放到plugins文件夹内,打开Eclipse,你会在菜单栏(Window)的子菜单(Preferences)内看到Hadoop Map/Reduce的选项。

- 下载hadoop-2.2.0.tar.gz压缩包到Win7环境后,解压到hadoop-2.2.0.tar.gz解压到hadoop-2.2.0。
- 配置变量环境HADOOP_HOME和path,如下图所示


- 设置Hadoop Map/Reduce的选项中Hadoop的位置。

解压hadoop2.6(x64).zip到hadoop2.6(x64),拷贝所有文件到hadoop-2.2.0bin目录 将hadoop.dll拷贝C:\Windows\System32目录下。
接下来便可进行hadoop的开发
打开mapReduce视图
Window -> Open Perspective -> Other 选择Map/Reduce,图标是个蓝色的象
添加一个连接的Map/Reduce环境
- 在 Map/Reduce Locations的视图里面右击选择“New Hadoop location...”,如图所示:

配置在弹出的对话框中填写如下内容:
Location Name:
这个不用在意,就是对这个MapReduce的标示,只要能帮你记忆即可
Map/Reduce Master 部分相关定义:
Host:上一节搭建的集群中JobTracker所在的机器的IP地址 port:JobTracker的端口(默认的是9001) 两个参数就是 mapred-site.xml中mapred.job.tracker的ip和端口 DFS Master部分: Host:就是上一节集群搭建中Namenode所在机器IP Port:就是namenode的端口 这两个参数是在 core-site.xml里fs.default.name里面的ip和端口
User Name: 就是搭建Hadoop集群是所用的用户名,我这里用的是had. 填写完以上信息以后,关闭Eclipse,然后重新启动。

通过DFS的插件操作本地文件上传到远程DFS文件系统

注意
在上传文件到DFS文件系统时,可以能会出现Name node is in safe mode
在分布式文件系统启动的时候,开始的时候会有安全模式,当分布式文件系统处于安全模式的情况下,文件系统中的内容不允许修改也不允许删除,直到安全模式结束。安全模式主要是为了系统启动的时候检查各个DataNode上数据块的有效性,同时根据策略必要的复制或者删除部分数据块。运行期通过命令也可以进入安全模式。在实践过程中,系统启动的时候去修改和删除文件也会有安全模式不允许修改的出错提示,只需要等待一会儿即可。如果不想等待可以使用命令Hadoop dfsadmin -safemode leave关闭Hadoop的安全模式或者修改dfs.safemode.threshold.pct为一个比较小的值,缺省是0.999。
用户可以通过dfsadmin -safemode value 来操作安全模式,参数value的说明如下:
enter - 进入安全模式
leave - 强制NameNode离开安全模式
get - 返回安全模式是否开启的信息
wait - 等待,一直到安全模式结束。
安全模式的退出前提 - 整个文件系统中的99.9%(默认是99.9%,可以通过dfs.safemode.threshold.pct设置)的Blocks达到最小备份级别(默认是1,可以通过dfs.replication.min设置)。
HDFS目录
在服务器上执行命令[root@centeostest /]# hdfs dfs -mkdir /input查看是否存在 input目录,如果有查看下权限[root@centeostest /]# hdfs dfs -ls /也可以用插件来查看是否建立HDFS的输入目录 使用hadoop fs -chmod 777 /你新建的目录
[root@centeostest /]# hdfs dfs -ls /
17/03/30 16:49:56 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 3 items
drwxr-xr-x - had supergroup 0 2017-03-30 09:34 /input
drwxr-xr-x - Administrator supergroup 0 2017-03-30 15:25 /output
drwxr-xr-x - Administrator supergroup 0 2017-03-30 15:20 /temp

新建hadoop-map/Reduce项目
步骤: File-->New-->Other-->Map/Reduce Project
导入项目文件即可体验Hadoop的WordCount入门。
项目名可以随便取,如WordCount。 复制 hadoop安装目录src/example/org/apache/hadoop/example/WordCount.java到刚才新建的项目下面。
在项目中可能涉及到你本地的用户上传HDFS权限的问题 org.apache.hadoop.io.nativeio 的NativeIO.java 类。http://www.genshuixue.com/i-cxy/p/15193768
8)运行程序
右键单击WordCount项目,选择Run As-->RunConfigurations…,弹出Run Configurations对话框。如下图所示:
右键单击左边的Java Application,选择New菜单新建一个配置项,取名为Wordcount。在Arguments选项卡中设置Program arguments:为:
hdfs://192.168.0.220:9000/input/test hdfs://192.168.0.220:9000/output/out1
第一行为输入文件,第二行为输出结果文件。
如果运行时报java.lang.OutOfMemoryError:Java heap space配置VM参数: -Xms512m -Xmx1024m -XX:MaxPermSize=256m 设置完后,单击Run。
常见错误请查看http://blog.csdn.net/yonghutwo/article/details/9206059 http://blog.csdn.net/collaboom/article/details/52015967 http://blog.csdn.net/yonghutwo/article/details/9206059
Eclipse-Hadoop开发配置详解的更多相关文章
- (图文教程)IntelliJ IDEA 导入Eclipse/MyEclipse 项目 配置详解+快捷键分享
(图文教程)IntelliJ IDEA 导入Eclipse/MyEclipse 项目 配置详解+快捷键分享 IntelliJ IDEA 使用教程.快捷键配置. 该教程针对原始jar包依赖的工程.mav ...
- 有关hadoop分布式配置详解
linux配置ssh无密码登录 配置ssh无密码登录,先要安装openssh,如下: yum install openssh-clients 准备两台linux服务器或虚拟机,设置两台linux的ho ...
- eclipse java formater 配置详解
comment.insert_new_line_before_root_tags(insert/do_not_insert):在Javadoc根标记块前插入空行,默认为insert: insert_s ...
- hadoop应用开发技术详解
<大 数据技术丛书:Hadoop应用开发技术详解>共12章.第1-2章详细地介绍了Hadoop的生态系统.关键技术以及安装和配置:第3章是 MapReduce的使用入门,让读者了解整个开发 ...
- 《Hadoop应用开发技术详解》
<Hadoop应用开发技术详解> 基本信息 作者: 刘刚 丛书名: 大数据技术丛书 出版社:机械工业出版社 ISBN:9787111452447 上架时间:2014-1-10 出版日期:2 ...
- Eclipse IDE for C/C++ Developers安装配置详解
Eclipse IDE for C/C++ Developers安装配置详解(转) 转自:http://hi.baidu.com/ltb6w/item/986532efd712460f570f1ddc ...
- 【eclipse插件开发实战】 Eclipse插件开发5——时间插件Timer开发实例详解
Eclipse插件开发5--时间插件Timer开发实例详解 这里做的TimeHelper插件设定为在菜单栏.工具栏提供快捷方式,需要在相应地方设置扩展点,最后弹出窗体显示时间. 在上一篇文章里创建好了 ...
- 【eclipse插件开发实战】 Eclipse插件开发6——eclipse在线翻译插件Translator开发实例详解
Eclipse插件开发6--eclipse在线翻译插件Translator开发实例详解 在上一篇文章中讲到了一个简单的eclipse插件开发实例,主要是对插件工程的基本创建步骤进行了讲解,这篇文章当中 ...
- 实时监控、直播流、流媒体、视频网站开发方案流媒体服务器搭建及配置详解:使用nginx搭建rtmp直播、rtmp点播、,hls直播服务配置详解
注意:这里不会讲到nginx流媒体模块如何安装的问题,只研究rtmp,hls直播和录制相关的nginx服务器配置文件的详细用法和说明.可以对照这些命令详解配置nginx -rtmp服务 一.nginx ...
- Windows-008-VirtualBox 安装 Win7 前沿配置详解
此文主要讲述在 Windows 系统下安装虚拟机 VirtualBox,及用 VirtualBox 安装 Win7 Professional 64bit 操作系统的前沿配置为例,配以图文进行详细的讲解 ...
随机推荐
- 【Surface Detection】Segmentation-Based Deep-Learning Approach for Surface-Defect Detection
物体表面缺陷检测现状 传统机器学习局限性 传统机器学习方法对于特定的算法只能解决特定的问题,不够灵活,无法快速适应新产品: 不同的问题有不同的特征,当需要解决新问题时,需要重新设计特征,开发周期长: ...
- 【原创】linux实时应用如何printf输出不影响实时性?
版权声明:本文为本文为博主原创文章,转载请注明出处 https://www.cnblogs.com/wsg1100.如有错误,欢迎指正. @ 目录 1. 前言 2. linux终端输出 3. 常见的N ...
- Loj 507 接竹竿 题解
Loj链接:接竹竿 $ {\scr \color {SkyBlue}{\text{Solution}}} $ 题目大意: 给定一个数组,每次加入一种颜色的数,可以取走与它颜色相同的两个数之间的所有数, ...
- 在Typescript项目中,使用ESLint和Prettier,以及解决保存代码后ESLint配置冲突问题
首先,检查项目中根目录.eslintrc.js文件,该文件中定义了ESLint的基础配置,找到其中的rules 例如: const prettierConfig = require('./.prett ...
- 【数据结构和算法】Trie树简介及应用详解
作者:京东物流 马瑞 1 什么是Trie树 1.1 Trie树的概念 Trie树,即字典树,又称单词查找树或键树,是一种树形结构,典型应用是用于统计,排序和保存大量的字符串(但不仅限于字符串),所以经 ...
- php 虚拟目录
问题: 站点的root目录为 /data/web/ ,现在想在www.111.com 下放一个站点,www.111.com/abc/ 但不能直接在/data/web/下创建abc目录,要放在 /dat ...
- Redis01 Redis详细介绍
参考:https://blog.csdn.net/u011863024/article/details/107476187 学习视频 redis官网 redis中文网 JAVA源码 1 sql的发展 ...
- 使用GetDIBits()获取Windows位图数据的标准用法,解决内存、堆栈报错问题
获取图标的位图数据 分两次使用GetDIBits(),以便于正确设置缓存的大小 正确设置BITMAPINFO的大小,否则就会报堆栈溢出错误 ICONINFO info = { 0 }; GetIcon ...
- vim之YouCompleteMe插件问题:The ycmd server SHUT DOWN (restart with ...low the instructions in the documen
cd ~/.vim/plugged/YouCompleteMe 然后运行./install.py 1.因为我是单独下载的Youcompleteme,所以要将整个文件夹拷贝到上述目录下,再运行
- 00-DLL劫持&C语言远程加载shellcode
0x01 杀软拦截检测规则引导-DLL劫持上线 准备工具 cs vs2019 dll劫持工具:https://bbs.pediy.com/thread-224408.htm 极速PDF:https:/ ...