第二章 Apache Hadoop2 linux下的编译
2015-09-07 20:56
549 查看
1, 如何安装
1.1 下载完Hadoop源码后,请解压Hadoop, 找到BUILDING.txt文件打开它,这里详细讲解的安装的过程。
(E:\hadoop-2.7.0-src)
2, 安装必要软件(Lunix)
2.1 JDK安装,这里不介绍了,如果不会的请先学习JAVA后,再学习Hadoop。
2.2Maven安装请查看另一篇博客/article/10289001.html
2.3Findbug安装,请先下载,地址为:http://findbugs.sourceforge.net/downloads.html
1) tar -zxvf findbugs-3.0.1.tar.gz
2) vim /etc/profile 插入如下内容
exportFINDBUGS_HOME=/usr/findbugs-3.0.1
export PATH=$PATH:$FINDBUGS_HOME/bin
3) 保存并退出VI编辑器,执行 source /etc/profile 命令使改动生效
2.4ProtocolBuffer安装必须使用2.5.0。下载地址 https://code.google.com/p/protobuf/downloads/list
1)tar -zxvf protobuf-2.5.0.tar.gz(必须是2.5.0版本的,不然编译hadoop的时候报错)
2)cd protobuf-2.5.0
3)执行:yum install gcc-c++,如果没有安装会包如下的错误
configure: error: in `/root/protobuf-2.5.0':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
4)./configure --prefix=/usr/local/protobuf
5) make && make install
6)vim /etc/profile
设置环境变量(如下命令)
exportPATH=$PATH:/usr/local/protobuf/bin
exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/protobuf/lib
7)执行 source /etc/profile
命令使改动生效
2.5安装CMake
下载地址:http://www.cmake.org/download/
1)安装g++和ncurses-devel
yum install gcc-c++
yum install ncurses-devel
2)tar -zxvf cmake-2.8.10.2.tar.gz
3)cd cmake-2.8.10.2
4)./configure --prefix=/usr/local/cmake
5) make && make install
6)vim /etc/profile
设置环境变量(如下命令)
PATH=/usr/local/cmake/bin:$PATH
exportPATH
7)执行 source /etc/profile
命令使改动生效
8)测试cmake --version
2.6安装zlib-devel
yum install zlib-devel
2.7安装openssl-devel
1) yuminstall openssl-devel
2.8安装Jansson
下载地址:http://www.digip.org/jansson/
1) tar -zxvfjansson-2.7.tar.gz
2)cd jansson-2.7
3)./configure
4) make && make install
2.8安装Linux FUSE
下载地址:http://sourceforge.net/projects/fuse/files/fuse-2.X/2.9.3/fuse-2.9.3.tar.gz/download
1) tar -zxvffuse-2.9.3.tar.gz
2)cd
fuse-2.9.3
3)./configure
4) make && make install
5)查看fuse是否挂载成功:
lsmod|grep fuse
6)若没成功则可通过:“modprobe fuse”命令挂载fuse。
2.9编译Hadoop源码
#cd hadoop
Createbinary distribution without native code and without documentation:
$ mvn package -Pdist -DskipTests -Dtar
Createbinary distribution with native code and with documentation:
$mvn package -Pdist,native,docs -DskipTests -Dtar
Createsource distribution:
$mvn package -Psrc -DskipTests
Create source and binary distributions with native code anddocumentation:
$ mvn package-Pdist,native,docs,src -DskipTests –Dtar(常用的命令)
Createa local staging version of the website (in /tmp/hadoop-site)
$ mvn clean site; mvn site:stage-DstagingDirectory=/tmp/hadoop-site
1.1 下载完Hadoop源码后,请解压Hadoop, 找到BUILDING.txt文件打开它,这里详细讲解的安装的过程。
(E:\hadoop-2.7.0-src)
2, 安装必要软件(Lunix)
2.1 JDK安装,这里不介绍了,如果不会的请先学习JAVA后,再学习Hadoop。
2.2Maven安装请查看另一篇博客/article/10289001.html
2.3Findbug安装,请先下载,地址为:http://findbugs.sourceforge.net/downloads.html
1) tar -zxvf findbugs-3.0.1.tar.gz
2) vim /etc/profile 插入如下内容
exportFINDBUGS_HOME=/usr/findbugs-3.0.1
export PATH=$PATH:$FINDBUGS_HOME/bin
3) 保存并退出VI编辑器,执行 source /etc/profile 命令使改动生效
2.4ProtocolBuffer安装必须使用2.5.0。下载地址 https://code.google.com/p/protobuf/downloads/list
1)tar -zxvf protobuf-2.5.0.tar.gz(必须是2.5.0版本的,不然编译hadoop的时候报错)
2)cd protobuf-2.5.0
3)执行:yum install gcc-c++,如果没有安装会包如下的错误
configure: error: in `/root/protobuf-2.5.0':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
4)./configure --prefix=/usr/local/protobuf
5) make && make install
6)vim /etc/profile
设置环境变量(如下命令)
exportPATH=$PATH:/usr/local/protobuf/bin
exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/protobuf/lib
7)执行 source /etc/profile
命令使改动生效
2.5安装CMake
下载地址:http://www.cmake.org/download/
1)安装g++和ncurses-devel
yum install gcc-c++
yum install ncurses-devel
2)tar -zxvf cmake-2.8.10.2.tar.gz
3)cd cmake-2.8.10.2
4)./configure --prefix=/usr/local/cmake
5) make && make install
6)vim /etc/profile
设置环境变量(如下命令)
PATH=/usr/local/cmake/bin:$PATH
exportPATH
7)执行 source /etc/profile
命令使改动生效
8)测试cmake --version
2.6安装zlib-devel
yum install zlib-devel
2.7安装openssl-devel
1) yuminstall openssl-devel
2.8安装Jansson
下载地址:http://www.digip.org/jansson/
1) tar -zxvfjansson-2.7.tar.gz
2)cd jansson-2.7
3)./configure
4) make && make install
2.8安装Linux FUSE
下载地址:http://sourceforge.net/projects/fuse/files/fuse-2.X/2.9.3/fuse-2.9.3.tar.gz/download
1) tar -zxvffuse-2.9.3.tar.gz
2)cd
fuse-2.9.3
3)./configure
4) make && make install
5)查看fuse是否挂载成功:
lsmod|grep fuse
6)若没成功则可通过:“modprobe fuse”命令挂载fuse。
2.9编译Hadoop源码
#cd hadoop
Createbinary distribution without native code and without documentation:
$ mvn package -Pdist -DskipTests -Dtar
Createbinary distribution with native code and with documentation:
$mvn package -Pdist,native,docs -DskipTests -Dtar
Createsource distribution:
$mvn package -Psrc -DskipTests
Create source and binary distributions with native code anddocumentation:
$ mvn package-Pdist,native,docs,src -DskipTests –Dtar(常用的命令)
Createa local staging version of the website (in /tmp/hadoop-site)
$ mvn clean site; mvn site:stage-DstagingDirectory=/tmp/hadoop-site
相关文章推荐
- Mac 配置 Apache .php
- 解决apache mina java.io.IOException: Connection timed out问题
- Atitit. Class  元数据的反射操作 api apache  工具
- Atitit. Class 元数据的反射操作 api apache 工具
- Atitit. Class 元数据的反射操作 api apache 工具
- zabbix监控apache
- Apache设置局域网内ip地址访问
- Ubuntu14.04 LTS下修改apache2默认端口
- [转]Windows7 64bit下配置Apache+PHP+MySQL
- apache+php安装(centos6.5)
- 安装xampp后apache不能启动解决方法
- Apache windows安装
- Apache Camel中的recipientList和routingSlip的区别?
- org.apache.commons.lang下的工具类
- [Centos]编译安装apache 2.4
- apache maven-release-plugin 版本管理方式
- php+apache+mysql环境配置
- apache common-io.jar FileUtils
- 零成本实现Web性能测试:基于Apache JMeter
- Apache Camel的multicast简单示例