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確實很少。