CentOS 6.4 中安装部署 Nutch 1.7
生活随笔
收集整理的這篇文章主要介紹了
CentOS 6.4 中安装部署 Nutch 1.7
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.配置SSH
自行查閱相關資料
2.安裝JDK,配置Java環境
自行查閱相關資料
3.安裝SVN
[root@master ~]# yum install -y subversion
通過SVN簽出(Check Out)Nutch源代碼
[root@master ~]# svn co https://svn.apache.org/repos/asf/nutch/tags/release-1.7/
4.安裝ANT,配置ANT環境
自行查閱相關資料
5.在~/release-1.7/conf/nutch-site.xml配置文件中增加'http.agent.name'配置
<!-- HTTP properties --> <property>
<name>http.agent.name</name>
<value>Mozilla/5.0 (Windows NT 6.3; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0</value>
<description>HTTP 'User-Agent' request header. MUST NOT be empty -
please set this to a single word uniquely related to your organization. NOTE: You should also check other related properties: http.robots.agents
http.agent.description
http.agent.url
http.agent.email
http.agent.version and set their values appropriately. </description>
</property>
6.進入Nutch所在目錄,執行ant命令,編譯Nutch源代碼
[root@master release-1.7]# ant
ANT構建之后會生成runtime目錄,該目錄下有deploy和local兩個目錄,分別代表了Nutch的兩種運行方式。
7.在local目錄中創建urls目錄
[root@master local]# mkdir urls
8.在urls目錄中通過VI編輯器創建url文件
[root@master local]# vi urls/url
9.在url文件中添加要抓取的URLs
http://www.leezhen.net/
10.開始抓取
[root@master local]# nohup bin/nutch crawl urls -dir data -depth 3 -threads 100 &
參考:?http://wiki.apache.org/nutch/NutchTutorial
總結
以上是生活随笔為你收集整理的CentOS 6.4 中安装部署 Nutch 1.7的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: STL:set的使用
- 下一篇: 第十九次ScrumMeeting会议