一、首先下载hadoop源码包
下载的方式还是比较多的
1.svn的方式
svn下载首先需要安装SVN,如果想尝试使用svn,可以参考 源码管理、获取网络源码工具:TortoiseSVN使用手册 ,hadoop的svn下载地址 点此
2.压缩包的方式
这里我们介绍一种压缩包的方式。
首先我们登录官网:
http://hadoop.apache.org/ ,我们找到下面链接,点进去下载即可。如果刚接触,不知道怎么下载,可以查看帖子 新手指导:hadoop官网介绍及如何下载hadoop(2.4)各个版本与查看hadoop API介绍 ,里面介绍的很详细。
二、解压
解压完毕,我们会看到相应的文件夹:
三、解压完毕,我们开始准备编译所需要的软件
这里软件的准备,很多文章写的都不全,这里整理一下。哪些软件是需要安装的。
1、jdk的安装
步骤下载压缩包、解压、配置环境变量
(1)jdk下载
链接: http://pan.baidu.com/s/1jGr41SU 密码: rawv
(2)jdk解压
然后重命令为:
(3)配置环境变量:
如下图所示红字部分为:(记得这里的路径改成自己的实际安装路径)
(4)检验是否安装成功
2、maven的安装
我这里已经安装
上面可能还需要配置环境变量之类的,但是我这里没有好像是系统自带的,网上的资料也比较多,注意maven的版本,我这里是3.0.4,hadoop2.4需要maven的这个版本或则更高的版本3.2.1版本也是可以的。
验证安装是否成功
3.protobuf的安装
为防止出错,这里补充一些内容,
3.1先安装g++
(1)下载
由于google不能访问,可以从网盘下载链接: http://pan.baidu.com/s/1dDgWe6P 密码:xgiu
(2)解压
如下效果:
然后进入protobuf-2.5.0文件夹,进行如下操作:
修改环境变量:
( LD_LIBRARY_PATH的这里,填写的是protobuf文件的位置 )
注意: 配置/etc/profile,在虚拟机重启后,可能配置会失效,所以重启后,需要再次执行source操作。
(3)验证
4.安装openssl库
5.CMake安装
或则
6.ant安装
(1)首先下载ant
百度网盘: apache-ant-1.9.4-bin.tar.gz
http://pan.baidu.com/s/1c0vjhBy
或则下面链接:
apache-ant-1.9.4-bin.tar.gz
(2)解压
(3)配置环境变量
如下图所示:
1.打开profile
2.添加下图红字部分,记得修改成自己的路径
3.生效
4.检验
四、编译hadoop2.4
上面准备工作已经做的差不多了,我们终于可以开始,记得进入src文件夹下,输入下面命令
等了40多分钟,ok
在目录~/hadoop-2.4.0-src/hadoop-dist/target下有文件:
hadoop-2.4.0.tar.gz
更多内容: hadoop2.4汇总:hadoop2.4插件下载、完全分布式、伪分布、eclipse插件开发大全
问题总结:
这里还需要在补充:
1.遇到错误1:CMake没有安装
解决方法:
CMake没有安装
或则使用
2.遇到错误2:ant没有安装
1.首先下载ant
百度网盘: apache-ant-1.9.4-bin.tar.gz
http://pan.baidu.com/s/1c0vjhBy
或则下面链接:
apache-ant-1.9.4-bin.tar.gz
2.解压
3.配置环境变量
记得配置环境变量
如下图所示:
1.打开profile 2.添加下图红字部分,记得修改成自己的路径
3.生效
4.检验
3.protobuf版本过低,错误现象
hadoop2.4对应的版本是protobuf-2.5.0
解决办法:按照安装步骤中protobuf的安装即可
4.权限问题
解决办法:
(1)加上sudo
(2)通过
下载的方式还是比较多的
1.svn的方式
svn下载首先需要安装SVN,如果想尝试使用svn,可以参考 源码管理、获取网络源码工具:TortoiseSVN使用手册 ,hadoop的svn下载地址 点此
2.压缩包的方式
这里我们介绍一种压缩包的方式。
首先我们登录官网:
http://hadoop.apache.org/ ,我们找到下面链接,点进去下载即可。如果刚接触,不知道怎么下载,可以查看帖子 新手指导:hadoop官网介绍及如何下载hadoop(2.4)各个版本与查看hadoop API介绍 ,里面介绍的很详细。
二、解压
解压完毕,我们会看到相应的文件夹:
三、解压完毕,我们开始准备编译所需要的软件
这里软件的准备,很多文章写的都不全,这里整理一下。哪些软件是需要安装的。
1、jdk的安装
步骤下载压缩包、解压、配置环境变量
(1)jdk下载
链接: http://pan.baidu.com/s/1jGr41SU 密码: rawv
(2)jdk解压
然后重命令为:
(3)配置环境变量:
如下图所示红字部分为:(记得这里的路径改成自己的实际安装路径)
(4)检验是否安装成功
2、maven的安装
我这里已经安装
上面可能还需要配置环境变量之类的,但是我这里没有好像是系统自带的,网上的资料也比较多,注意maven的版本,我这里是3.0.4,hadoop2.4需要maven的这个版本或则更高的版本3.2.1版本也是可以的。
验证安装是否成功
3.protobuf的安装
为防止出错,这里补充一些内容,
3.1先安装g++
(1)下载
由于google不能访问,可以从网盘下载链接: http://pan.baidu.com/s/1dDgWe6P 密码:xgiu
(2)解压
如下效果:
然后进入protobuf-2.5.0文件夹,进行如下操作:
修改环境变量:
( LD_LIBRARY_PATH的这里,填写的是protobuf文件的位置 )
注意: 配置/etc/profile,在虚拟机重启后,可能配置会失效,所以重启后,需要再次执行source操作。
(3)验证
4.安装openssl库
5.CMake安装
或则
6.ant安装
(1)首先下载ant
百度网盘: apache-ant-1.9.4-bin.tar.gz
http://pan.baidu.com/s/1c0vjhBy
或则下面链接:
apache-ant-1.9.4-bin.tar.gz
(2)解压
(3)配置环境变量
如下图所示:
1.打开profile
2.添加下图红字部分,记得修改成自己的路径
3.生效
4.检验
四、编译hadoop2.4
上面准备工作已经做的差不多了,我们终于可以开始,记得进入src文件夹下,输入下面命令
等了40多分钟,ok
在目录~/hadoop-2.4.0-src/hadoop-dist/target下有文件:
hadoop-2.4.0.tar.gz
更多内容: hadoop2.4汇总:hadoop2.4插件下载、完全分布式、伪分布、eclipse插件开发大全
问题总结:
这里还需要在补充:
1.遇到错误1:CMake没有安装
解决方法:
CMake没有安装
或则使用
2.遇到错误2:ant没有安装
1.首先下载ant
百度网盘: apache-ant-1.9.4-bin.tar.gz
http://pan.baidu.com/s/1c0vjhBy
或则下面链接:
apache-ant-1.9.4-bin.tar.gz
2.解压
3.配置环境变量
记得配置环境变量
如下图所示:
1.打开profile 2.添加下图红字部分,记得修改成自己的路径
3.生效
4.检验
3.protobuf版本过低,错误现象
hadoop2.4对应的版本是protobuf-2.5.0
解决办法:按照安装步骤中protobuf的安装即可
4.权限问题
解决办法:
(1)加上sudo
(2)通过