[HD] Hadoop生态系统搭建:13.Nutch2

1.下载apache-nutch-2.3.1-src.zip 下载地址http://archive.apache.org/dist/nutch/2.3.1/apache-nutch-2.3.1-src.zip
我的计划安装目录: /home/hadoop/BigData/apache-nutch-2.3.1

$ unzip apache-nutch-2.3.1-src.zip -d /home/hadoop/BigData/

 

为避免报错 [taskdef] Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found.
下载sonar-ant-task-2.2.jar http://central.maven.org/maven2/org/codehaus/sonar-plugins/sonar-ant-task/2.2/sonar-ant-task-2.2.jar,并放到apache-nutch-2.3.1路径下。并修改vi build.xml,参考如下内容中的fileset一行

<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
<classpath path="${ant.library.dir}" />
<classpath path="${mysql.library.dir}" />
<classpath><fileset dir="/home/hadoop/BigData/apache-nutch-2.3.1" includes="sonar*.jar" /></classpath>
</taskdef>

2.开始编译

$ cd /home/hadoop/BigData/apache-nutch-2.3.1
$ ant

时间较长,请耐心等待

$ mv /home/hadoop/BigData/apache-nutch-2.3.1 /home/hadoop/BigData/nutch-2.3.1

3.设置环境变量 vi .bash_profile添加如下内容:

export NUTCH_HOME=/home/hadoop/BigData/nutch-2.3.1/runtime/local
export PATH=$PATH:$NUTCH_HOME/bin

 

至此,nutch2安装完成

分类上一篇:     分类下一篇:

Leave a Reply