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了

  • 相关阅读:
    使用钉钉对接禅道的bug系统,实现禅道提的bug实时在钉钉提醒并艾特对应的开发人员处理
    Python3数据驱动ddt
    Python3发送邮件功能
    Python3的日志添加功能
    【最小生成树】BZOJ1016: [JSOI2008]最小生成树计数
    【k短路&A*算法】BZOJ1975: [Sdoi2010]魔法猪学院
    【最小生成树+子集枚举】Uva1151 Buy or Build
    【最小生成树】UVA1494Qin Shi Huang's National Road System秦始皇修路
    【最小生成树+贪心】BZOJ1821: [JSOI2010]Group 部落划分 Group
    【差分+前缀和】BZOJ1637: [Usaco2007 Mar]Balanced Lineup
  • 原文地址:https://www.cnblogs.com/pangblog/p/3402531.html
Copyright © 2011-2022 走看看