Hadoop这个东西之前就听说过,但是,一直没有用得上的地方,也就一直没有去学它。现在,毕设要用上了,就打算好好学一下。今天(2014-3-24)开始折腾它,发现网上的资料真是多的不能再多了,同时,也是非常的乱。尤其,在针对不同的Hadoop版本上,可能是因为Hadoop还在快速发展,学习资料方面还在跟进中,官方wiki好像都没有完全将概念整理好。现在,整理整理我已经找到的资料。
前置要求
机器的要求
开发机器
4G内存是至少的,2G内存跑起来十分卡。
Hadoop集群
操作系统&Java要求
- Java 1.6.x or higher, preferably from Sun
- Linux and Windows are the supported operating systems, but BSD, Mac OS/X, and OpenSolaris are known to work. (Windows requires the installation of Cygwin).
来自官方FAQ
版本
Hadoop版本
- 0.19.x-0.20.x
- 0.23.x
- MapReduce2引入,MapReduce NextGen 又叫YARN又叫MRv2
- ResourceManager、NodeManager引入,替代JobTracker、TaskTracker。早期版本的书中会提到后两者,但现在实际上看到的是前两者的概念。
- 1.x
- 2.2.x 我所采用的版本
- 2.3.x
HBase版本
官方给出的Hadoop和HBase的组合方式矩阵,看这里。
- HBase-0.92.x
- HBase-0.94.x
- HBase-0.96.0
- HBase-0.98.0(Hadoop-2.2.0,Hadoop-2.x)
Nutch版本
- Nutch 1.x: A well matured, production ready crawler. 1.x enables fine grained configuration, relying on Apache Hadoop™ data structures, which are great for batch processing.
- Nutch 2.x: An emerging alternative taking direct inspiration from 1.x, but which differs in one key area; storage is abstracted away from any specific underlying data store by using Apache Gora™ for handling object to persistent mappings. This means we can implement an extremely flexibile model/stack for storing everything (fetch time, status, content, parsed text, outlinks, inlinks, etc.) into a number of NoSQL storage solutions.
环境搭建
Hadoop搭建
- Standalone mode(独立模式,开发调试使用,Hadoop刚下载下来时,默认的配置就是以这样的方式运行的。)
- Pseudo-distributed mode(伪集群模式,开发调试使用,搭建这种模式的资料,网上非常多。)
- Hadoop0.20.203.0搭建教程 非常详细
- Hadoop2.2.0搭建教程 我是部分参考这篇
- 如果在尝试运行hdfs时,出现这个错误 ssh: Could not resolve hostname will 原因在于Hadoop的一些库是编译在32位的机器上的,x64下会有些问题。具体看这里
- 简单的步骤
- 配置passwordless ssh.
- 配置etc/hadoop 下面的配置文件。
- 配置bashrc中的环境变量,并修正在x64下的hdfs BUG(ssh: Could not resolve hostname will)
- 创建目录dfs/data name,mapreduce目录,并format namenode.
- start-dfs&start-yarn.
- 官网上的教程 估计不是给初学者看的
- Hadoop0.19.1 on windows
- MapReduce管理页面 http://localhost:8088/cluster
- HDFS管理页面 http://localhost:50070/dfshealth.jsp
- Fully distributed mode(真集群模式)
- hadoop 2.0 详细配置教程 看起来很不错
HBase搭建
- Standalone mode(独立模式,官方文档)
- Distributed mode(分布式模式,官方文档)
- HBase管理页面 http://localhost:60010/master-status
- HBase管理页面 http://localhost:60010/master-status
Eclipse插件
资料
Hadoop书籍
从我找到书来看,好像没有跟上最新的版本(稳定版2.2.0,最新版2.3.0)。
- Hadoop: The Definitive Guide Third Edition
- Hadoop Real-World Solutions Cookbook
- Hadoop in Action(这本书的讲述方式比较适合人类正常的学习过程,完全从零开始,从一步步教你搭建集群,再在上面写程序。上面那两本,一开始就假设了集群已经搭建好了。唯一的问题是,Hadoop版本有点老(2010年写的),它说的和我看到的有很多地方不一样。作者没说它是什么版本的,估计是0.20.0左右的。)
- Pro Hadoop
- 官方书籍列表 2.x确实很少。
Hadoop相关论文
Hadoop相关文章