Nutch-1.2 configuration under Ubuntu

Source: Internet
Author: User
1. Download nutch1.2 to a specified directory and open eclipse to create a new java project. And select "Createprojectfromexistingsource" to point to the nutch directory. 2. Next, switch to "Libraries" and select "AddClassFolder... "button, select" conf "from the list, continue operation: switch to" OrderandExport "find" conf "and move it to the top.

1. Download nutch1.2 to a specified directory and open eclipse to create a new java project. And select "Create project from existing source" to point to the nutch directory.

2. Next, switch to "Libraries" and select "Add Class Folder... "button, select" conf "from the list, continue operation: switch to" Order and Export "find" conf ", and move it to the top.

3. Go to "Source" and set output folder to Nutch/bin/tmp_build. Click finish to finish the import.

4. configuration file: Maid, fig.
1) nutch-default.xml
Modify here:

Plugin. folders
./Src/plugin
Directories where nutch plugins are located. Each
Element may be a relative or absolute path. If absolute, it is used
As is. If relative, it is searched for on the classpath.

2) nutch-site.xml

In Add:

Http. agent. name

My nutch agent

Http. agent. version

1.0

 

32.16crawl-urlfilter.txt

Delete: MY. DOMAIN. NAME

Adding: + ^ http: // ([a-z0-9] */.) * qq.com/

The following is your practice: directly configure accept anything else to "+ .".

Create weburls.txt in the nutchdirectory and add the entry address: http://www.qq.com

5. Capture

Run crawl executable class
Configure the runtime environment:
Program arguments:
Bin/nuttch crawl weburls.txt-dir localweb-depth 50-topN 100-threads 2

VM arguments:
-DHadoop. log. dir = logs-Dhadoop. log. file = hadoop. log

6) Some errors may occur, for example, the class cannot be found. At this time, you may need to re-compile the nutch with ant, switch to the installation root directory of the nutch, and then execute the ant command. After compilation, try again.

PS: the blue part of this article is your own practice. For other references, see other articles.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.