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 操作系统的前沿配置为例,配以图文进行详细的讲解 ...
随机推荐
- Quorum NWR
1.强一致性与最终一致性 1.1强一致性 强一致性能保证写操作完成后,任何后续访问都能读到更新后的值:强一致性可以保证从库有与主库一致的数据.如果主库突然宕机,我们仍可以保证数据完整.但如果从库宕机或 ...
- Blazor如何实现类似于微信的Tab切换?
是否有小伙伴在使用tab的时候想进行滑动切换Tab? 并且有滑动左出左进,右出右进的效果 ,本文将讲解怎么在Blazor中去通过滑动切换Tab 本文中的UI组件使用的是MASA Blazor,您也可以 ...
- maven打包出现Failed to execute goal xxx.plugins:maven-compiler-plugin:3.7.0:compile.......:Fatal error compiling解决方法
起初在给项目打包时出现了这个错: 网上查了很多资料,都说JDK配置不对,我检查了一下,发现明明都一样. 为了获取更详细的报错信息,我决定用命令行的打包方式来编译: cd进去要打包的这个目录,用命令行的 ...
- 12月6日内容总结——BOM、DOM、两者查找标签的方式和操作标签的方式、操作class和css的方法、事件、jQuery类库
目录 一.BOM操作 BOM概念 window对象 window的子对象 navigator对象(了解即可) screen对象(了解即可) history对象(了解即可) location对象 弹出框 ...
- day05-SpringMVC底层机制简单实现-01
SpringMVC底层机制简单实现-01 主要完成:核心分发控制器+Controller和Service注入容器+对象自动装配+控制器方法获取参数+视图解析+返回JSON格式数据 1.搭建开发环境 创 ...
- Cnblogs博客皮肤开发调试最佳方案
Cnblogs博客园支持自定义js来美化站点(需要申请JS权限),可以将主题托管到自己的云资源或CDN加速节点节点上. 例如我的网站为 www.example.com(IP或其它host),我将编译后 ...
- 重学SpringBoot. step7 高并发 秒杀
高并发 高并发最容易出现的问题就是数据安全能不能得到保障. 你需要保证速度,又需要保证数据安全,那么速度也必然会有所下降. 所以最简单的办法就是提升硬件.或者把Mysql换成MongoDB,加个Red ...
- day07-SpringMVC底层机制简单实现-03
SpringMVC底层机制简单实现-03 https://github.com/liyuelian/springmvc-demo.git 7.任务6-完成控制器方法获取参数-@RequestParam ...
- Vue 26 plugins
1 简介 它是用来增强vue的.它是包含install方法的一个对象,install的第一个参数是Vue,第二个以后参数是插件使用者传入的参数 插件里面可以配置全局过滤器.全局指令.混入.Vue原型上 ...
- JAVA虚拟机10---内存分配策略
1.简介 对象的内存分配,从概念上讲,应该都是在堆上分配(而实际上也有可能经过即时编译后被拆散为标量类型并间接地在栈上分配).在经典分代的设计下,新生对象通常会分配在新生代中,少数情况下(例如对象大小 ...