0. First download hadoop-2.5.2 source package
Download address: http://hadoop.apache.org/releases.html
2. Unzip
tar zxvf hadoop-2.5.2-src.tar.gz
3. After decompression, we start to prepare the software we need to compile
Install apache-maven
3.1. When installing hadoop-2.5.2, the wget command may not be available, and the wget tool needs to be installed.
If the yum source is configured, we can install the wget tool like this. as follows:
Configure yum source: http://mirrors.163.com/.help/centos.html
Install the wget tool: yum -y install wget
3.2. Install maven (it is recommended to download and install manually. If the network is not good, it is easy to fail in the following way.)
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
yum -y install apache-maven
The 3.3.tzdata-java-2015g-2.el6.noarch.rpm source cannot be used and the installation fails.
http://mirrors.ustc.edu.cn/centos/6/updates/i386/Packages/tzdata-java-2015g-2.el6.noarch.rpm: [Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=updates clean metadata
Workaround: Use http://mirrors.ustc.edu.cn/centos/6/updates/i386/Packages/tzdata-java-2015g-2.el6.noarch.rpm to download tzdata-java-2015g-2 manually. el6.noarch.rpm, then install using the command.
At this time, execute the yum -y install apache-maven command again
4. Install ProtocolBuffer
Download address: http://vdisk.weibo.com/s/BICjq6gk87iV5
Install manually after downloading
5. The software installed using the yum command is installed under that directory by default
eg: To find the installation directory of apache-maven, you can use find / -name apache-maven* -type d
6. Find the folder in linux
find / -name apache-maven* -type d (find directory: find / (search scope) -name 'find keyword' -type d.)
7. How to view the usage of linux commands
8. Before compiling, first modify conf/settings.xml in the maven installation directory (because of the repository used by maven, it is sometimes inaccessible in China, and can be modified to an available mirror), add in <mirrors></mirros>, other No need to change, the specific changes are as follows:
<mirror>
<id>nexus-osc</id>
<mirrorOf>*</mirrorOf>
<name>Nexusosc</name>
<url>http://maven.oschina.net/content/groups/public/</url>
</mirror>
9. Configure domain name under linux
/etc/hosts
10. When using virtualBox, the host name of the copied virtual machine is the same, modify the host name
/etc/sysconfig/network
11.hadoop-aboutyun-linux64-2.5.2.tar.gz download address
Link: http://pan.baidu.com/s/1bnH94xp Password: 3fp5
12. ZKFC can only be formatted after zookeeper is started, otherwise an error will be reported.
13. You can't see the verification code picture when you register About Cloud, you can view the source code of the webpage
14.Unable to load native-hadoop library for your platform... using builtin-java classes where applicable,如下图:
The solution to the error caused by the inconsistency between the Hadoop native library and the system version
Reference: http://www.linuxidc.com/Linux/2012-04/59200.htm
wget http://ftp.gnu.org/gnu/glibc/glibc-2.19.tar.bz2
wget http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.5.tar.bz2
解压
$tar -jxvf glibc-2.19.tar.bz2
$cd glibc-2.19
$tar -jxvf ../glibc-linuxthreads-2.5.tar.bz2
$cd ..
$export CFLAGS="-g -O2"
$./glibc-2.19/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
$make
#make install
Note: Although it is prompted to use GLIBC_2.14, the installation may report an error. GLIBC_2.19 is recommended
15.Which directory is downloaded by wget? under the current directory
17. What is the role of ./configure, make, make install?
In the end, the compilation failed, and the Great Wall's network was not strong. If the network is strong, it is easy to compile successfully. . . .
If the network is not good, you can download the 64-bit hadoop installation package compiled by others: hadoop-aboutyun-linux64-2.5.2.tar.gz
maven library: http://maven.net.cn/content/groups/public/
http://cwiki.apache.org
Reference: http://www.iteblog.com/archives/897
Reference: http://www.csdn123.com/html/topnews201408/84/1984.htm
mirrorOf in Maven settings configuration: http://blog.csdn.net/isea533/article/details/21560089
Bridge: http://wenku.baidu.com/link?url=eBCnoOeSJaM6-LLXZofAFL0odFLNgWRxNkGBi8X70xe422kgC2cKESnccnbEss3Ph4UAYP20yxwpl_tLZXwLIG19RqOXZuqJUszGFxafZZu