nutch 安裝部署 以nutch2.3.1 爲例

最近在研究nutch 在Ubuntu系統上安裝部署nutch,nutch安裝步驟以下: 一、先 安裝ANT (ant下載安裝包就不寫了 百度一大把) //解壓 ant sudo tar -zxvf /usr/test/soft/apache-ant-1.9.7-bin.tar.gz -C /usr //移動ant (這裏只是把安裝的文件放到一目錄下,方便管理。) sudo mv /usr/test/apache-ant-1.9.7 /usr/test/ant1.9 修改/usr/test/ant1.9/bin/ant文件,添加以下內容 export JAVA_HOME=/usr/jdk1.7
這裏須要修改在ant文件中添加java_home 的路徑java

二、安裝nutch //解壓nutch sudo tar -zxvf /usr/test/soft/apache-nutch-2.3.1-src.tar.gz -C /usrmysql

//移動nutch sudo mv /usr/test/apache-nutch-2.3.1/usr/test/nutch2.3sql

修改/usr/jiankongyun/nutch2.3/ivy/ivy.xml文件,添加以下內容 <dependency org="org.apache.gora" name="gora-mongodb" rev="0.6.1" conf="*->default" /> //這裏用的是mongodb3.2 安裝步驟後面的會有詳細的文章 特別注意的一點就是 gora 的版本必定要對應,版本過高或者過低都會出現不兼容的問題,仍是儘可能使用官方的推薦版本mongodb

//編譯nutch cd /usr/test/nutch2.3 /usr/test/ant1.9/bin/ant runtimeapache

編譯nutch的過程當中 你可能會獲得以下錯誤: Trying to override old definition of task javac [taskdef] Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found.ide

ivy-probe-antlib:ui

ivy-download: [taskdef] Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found. 解決方法: 下載sonar-ant-task-2.1.jar,將其拷貝到nutch2.3/lib 目錄下面 修改build.xml,引入上面添加的jar包:this

<!-- Define the Sonar task if this hasn't been done in a common script -->spa

<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="." includes="sonar*.jar" /></classpath> </taskdef>.net

添加完成後再次運行 編譯nutch 就能夠了。

固然有什麼不懂的 能夠留言咱們www.jiankongyun.net能夠多多交流

相關文章
相關標籤/搜索