日期:2014-05-16 浏览次数:20802 次
一、问题症状:
在安装hadoop的时候报类似如下的错误:
# A fatal error has beendetected by the Java Runtime Environment:
#
# SIGFPE (0x8) atpc=0x40008026, pid=31393, tid=2283477936
#
# JRE version:6.0_29-b08
# Java VM: JavaHotSpot(TM) Client VM (20.4-b01 mixed mode linux-x86 )
# Problematic frame:
# C [ld-linux.so.2+0x8026] double+0xb6
#
# If you would like tosubmit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happenedoutside the Java Virtual Machine in native code.
# See problematic framefor where to report the bug.
二、问题原因:
Hadoop依赖的本地库与操作系统不兼容,需要在本地重新编译依赖的so包。
三、解决过程:
1. 在$HADOOP_HOME目录下执行以下语句来编译:
ant -Dcompile.native=true compile-native
2. 由于ant使用了maven来做编译,而maven需要连网下载依赖的jar包,由于我们的环境是通过代理上网的,所以在执行上面的命令时会有报错,应要先设置ant的代理上网环境变量:
export ANT_OPTS="-Dhttp.proxyHost=10.3.1.6-Dhttp.proxyPort=8080"
3. 上述问题解决后,在编译过程中又提示没有zlib,就是本机没有安装zlib,如果不提示这个错误请忽略以下这个过程。下面是安装zlib的过程,从官方网站下载zlib库,下载地址如下。
http://zlib.net/zlib-1.2.8.tar.gz
mkdir zlib
cp zlib-1.2.8.tar.gz zlib
gzip –d zlib-1.2.8.tar.gz
tar xvf zlib-1.2.8.tar
cd zlib-1.2.8
./configure
make
sudo make install
上面的过程就完成了zlib的安装,
当使用wget命令下载时,若要使用代理,则可以参考如下命令:
wget -e http-proxy=10.3.1.6:8080 --proxy=on -c http://zlib.net/zlib-1.2.8.tar.gz
4. 然后再执行步骤1的命令,就完成了hadoop本地库的编译,编译产生的新本地库在以下目录:
$HADOOP_HOME/build/native/**ux-amd64-64/lib
5. 将上述目录下的文件全部copy到namenode的以下目录:
cd $HADOOP_HOME/build/native/**ux-amd64-64/lib
cp * $HADOOP_HOME/lib/native/**ux-amd64-64
同时还需要copy上述的包到各个datanode的相应目录下:
cd $HADOOP_HOME/lib/native/**ux-amd64-64
scp * aihadoop@10.3.3.142:~/hadoop/hadoop-1.0.0/lib/native/Linux-amd64-64/
scp * aihadoop@10.3.3.143:~/hadoop/hadoop-1.0.0/lib/native/Linux-amd64-64/
6. 然后在namenode上执行以下命令启动hadoop:
./start-all.sh
7. 输出日志大概如下,表示启动成功:
aihadoop@suse-141:~/hadoop/hadoop-1.0.0/bin>./start-all.sh
Warning: $HADOOP_HOME is deprecated.
starting namenode, logging to /home/aihadoop/hadoop/hadoop-1.0.0/libexec/../logs/hadoop-aihadoop-namenode-suse-141.out
10.3.3.143: starting datanode, logging to/home/aihadoop/hadoop/hadoop-1.0.0/libexec/../logs/hadoop-aihadoop-datanode-suse10t143.out
10.3.3.142: starting datanode, logging to /home/aihadoop/hadoop/hadoop-1.0.0/libexec/../logs/hadoop-aihadoop-datanode-suse-142.out
10.3.3.141: starting secondarynamenode, logging to/home/aihadoop/hadoop/hadoop-1.0.0/libexec/../logs/hadoop-aihadoop-secondarynamenode-suse-141.out
starting jobtracker, logging to/home/aihadoop/hadoop/hadoop-1.0.0/libexec/../logs/hadoop-aihadoop-jobtracker-suse-141.out
10.3.3.143: starting tasktracker, logging to/home/aihadoop/hadoop/hadoop-1.0.0/libexec/../logs/hadoop-aihadoop-tasktracker-suse10t143.out
10.3.3.142: starting tasktracker, logging to/home/aihadoop/hadoop/hadoop-1.0.0/libexec/../logs/hadoop-aihadoop-tasktracker-suse-142.out