Nutch1.4安装及测试
来源:互联网 发布:货运app软件 编辑:程序博客网 时间:2024/06/11 22:14
Nutch安装及测试
一 安装环境:
Ubuntu 版本:11.10
Kernel 版本:3.0.0.12-generic
二 安装Java的JDK
安装JDK命令:apt-getinstall openjdk-6-jdk
三 下载Nutch及解压安装
Nutch版本:apache-nutch-1.4-bin.tar.gz
命令下见图:
四 设置环境变量:
问题一:当设置完环境变量后,在命令行输入”nutch”,然后回车,无法运行nutch,且出现现提示:“/home/is11/lidexin/apache-nutch-1.4-bin/runtime/local/bin/nutch:Permission denied”
解决方法:在目录“/home/is11/lidexin/apache-nutch-1.4-bin/runtime/local/bin/”下输入命令“chmod +x nutch”,然后回车。(见下图)
(注意此问题不一定会出现,我在ubuntu10.04上安装Nutch时就没出现过)
五 建立urls目录
在目录“/apache-nutch-1.4-bin/runtime/local”下建立urls目录,见下图
六 在urls目录下建立url.txt文件,并输入你想爬的网站网址。
七 编辑nutch-site.xml文件。
进入到/apache-nutch-1.4-bin/runtime/local/conf目录下,修改nutch-site.xml文件。命令见下图。
添加内容如下:
八 编辑regex-urlfilter.txt文件
进入到/apache-nutch-1.4-bin/runtime/local/conf目录下,修改regex-urlfilter.txtl文件,在“# accept anything else”下面输入:“+^http://([a-z0-9*\.])*mittrchinese.com/”,然后保存,见下图
九 开始爬了
命令:nutch crawl urls –dir crawl –depth 3 –topN 5
此命令的意思:“We are using the nutch crawlcommand. The urlsdir is the urls directory that we added to the distributedfilesystem. (I've called it "urlsdir" to make it clearer that itisn't merely the *file* containing urls). The "-dir crawl" is theoutput directory. This will also go to the distributed filesystem. The depth is3 meaning it will only get 3 page links deep. There are other options you canspecify, see the command documentation for those options.”
引之网站:http://wiki.apache.org/nutch/NutchHadoopTutorial
问题二:出现错误提示,见下图
解决方法如下:
回到/apache-nutch-1.4-bin/runtime/local目录下,执行“chmod +x urls”命令,回车。
(注意此问题不一定会出现,我在ubuntu10.04上安装Nutch时就没出现过)
重新输入命令:nutch crawl urls –dir crawl –depth 3 –topN 5
屏幕显示如下:
借鉴的主要网站:http://nutch.apache.org/
http://www.open-open.com/lib/view/open1328670771405.html
http://www.cnblogs.com/wycg1984/archive/2010/06/25/1764926.html
http://luckaway.iteye.com/blog/568496
http://www.cppblog.com/AutomateProgram/archive/2011/05/04/145657.html
http://blog.csdn.net/Mylady58/article/details/5891190
http://wiki.apache.org/nutch/NutchHadoopTutorial
- Nutch1.4安装及测试
- windows下nutch1.0环境搭建及测试
- Centos7下安装配置nutch1.4
- Linux安装nutch1.9
- nutch1.9安装
- Nutch1.9安装
- nutch1.9--nutch安装记录
- Nutch1.2的安装使用。
- Nutch1
- nutch1.4 + solr3.5 上路
- 于nutch1.4的使用
- Windows下开源搜索引擎Nutch1.2的安装
- Nutch1.2 的安装与使用
- nutch1.6安装使用中错误解决方法
- hoop安装及测试
- pylearn2安装及测试
- Maven 安装及测试
- 安装Cython及测试
- SVN 常用操作及常见问题
- 鼠标点击事件按钮和触电坐标
- linux socket编程中出现发送或接收错误时退出程序问题
- 第二周C++作业 任务一 任务二 任务三。
- 堆和栈
- Nutch1.4安装及测试
- Myeclipse 安装spket插件
- C++ Primer 第4章 习题4.34
- Oracle OS Watcher 工具 使用详解
- Flash反编译工具(Sonne Flash Decompiler)
- GOF设计模式
- Android 设置横屏模式显示
- poj 3041 二分图最小顶点覆盖 小行星删行或列
- 汉拿山