Hadoop-0.20.2的PiEstimator问题
直接运行Hadoop-0.20.2的PiEstimator.java的话,会报"java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result." 的错误,原因是算出的Pi值没有设定小数位数(Pi是无理数)。
解决方法:
1、去https://issues.apache.org/jira/browse/MAPREDUCE-1880下载m1880_20100619_0.20.patch。
2、为hadoop-0.20.2打上这个补丁
[root@master:/opt/hadoop-0.20.2]# patch -p0 < ../hadoopPatch/m1880_20100619_0.20.patch
3、修改$HADOOP_HOME/build.xml
? ? ?将line904和line908的两句注释掉,修改成如下所示:
<target name="forrest.check" unless="forrest.home" depends="java5.check">
<!--fail message="'forrest.home' is not defined. Please pass -Dforrest.home=<base of Apache Forrest installation> to Ant on the command-line." /-->
</target>
<target name="java5.check" unless="java5.home">
<!--fail message="'java5.home' is not defined. ?Forrest requires Java 5. ?Please pass -Djava5.home=<base of Java 5 distribution> to Ant on the command-line." /-->
</target>
4、重新build
[root@master:/opt/hadoop-0.20.2]# ant package