zoukankan      html  css  js  c++  java
  • [置顶] Linux下将Nutch1.3导入eclipse

    1、准备工作

         首先去官网下载好 apache-nutch-1.3-bin.zip

          解压apache-nutch-1.3-bin.zip

               [pig@CentOs ]$ unzip   apache-nutch-1.3-bin.zip

          解压后生成的文件夹 nutch-1.3

          Apache官只有最近版本,没有1.3的了,我已将相关版本分享到  http://yunpan.cn/Q9LQVKuhBnSJ3


    2、新建项目,导入jar包以及配置文件和插件

          a、在eclipse中新建一个Java项目,取名 nutch-1.43         

          b、将解压后生成的文件夹中的src中的java里面的所有内容复制到项目的src下;

          c、将runtime/local下的conf (必选)、 plugins(可选)文件夹复制到项目中,与src同级;

          d、将conf文件夹添加为Source  Folder ;

          e、将runtime/local中的lib下面的jar包添加到classpath,方法是右键项目 -> Bulid Path -> Add External Archives ,找到工作目录下的lib,选中所有的jar即可。


    3、修改conf下相关配置文件

         

         3.1 修改  nutch-default.xml

                 a、配置http.agent.name如图:

                

               代码 :

    <property>
      <name>http.agent.name</name>
      <value>pig</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>

              b、修改http.agent.version ,如图:


             代码:

    <property>
      <name>http.agent.version</name>
      <value>Nutch-1.3</value>
      <description>A version string to advertise in the User-Agent 
       header.</description>
    </property>


              c、修改plugin.folders ,如图:


         代码:

    <property>
      <name>plugin.folders</name>
      <value>plugins</value>
      <description>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.</description>
    </property>

                  

        注意:plugin.folders 的 value需要指向 插件所在的路径,由于第二步已经将runtime/local下的插件 plugins文件夹复制到项目中,所以这里可以直接写相对路径,如果没有复制这个plugins文件夹,就需要指向插件路径。


         3.2 修改 nutch-site.xml 

                  如图:

            
                       这里agent的value需要和  nutch-default.xml 里面的值一样。。


    经过以上配置,即可在eclipse里运行nutch1.3了

  • 相关阅读:
    fork()和vfork()的区别(转载)
    Linux中fork()函数详解(转载)
    ERROR:Simulator861-Failed to link the design解决办法
    ISE 14.7安装教程最新版(Win10安装)
    实验2用户及文件权限管理
    检验
    实验1基本概念及操作
    日常学习笔记(2)
    日常笔记1
    拷贝初始化的几种情况
  • 原文地址:https://www.cnblogs.com/pangblog/p/3402531.html
Copyright © 2011-2022 走看看