• Nutch2.3 编译和安装配置


    Nutch2.3 编译和安装配置

    [一]、介绍

    Nutch 是一个开源Java 实现的搜索引擎。它提供了我们运行自己的搜索引擎所需的全部工具。包括全文搜索和Web爬虫。现在Nutch分为两个版本:1.x和2.x,这两个版本的 主要区别在于底层的存储不同。1.x版本是基于Hadoop架构的,底层存储使用的是HDFS,而2.x通过使用Apache Gora,使得Nutch可以访问HBase、Cassandra、MySQL、DataFileAvroStore、AvroStore等等。

    [二]、编译配置

    目前官方2.x只提供了源码下载,不再提供编译发布版本,需要用户自己去编译。

    2.1 下载解压源码

    官方下载: Nutch2.x 源码 ,目前为止最新版本2.2.1,下载后解压:

    tar  zxf apache-nutch-2.2.1-src.tar.gz

    2.2  修改 $NUTCH_HOME/conf/nutch-site.xmlconfiguration 节点中增加如下内容:

    <property>
      <name>storage.data.store.class</name>
      <value>org.apache.gora.hbase.store.HBaseStore</value>
      <description>Default class for storing data</description>
    </property>

    2.3 修改 $NUTCH_HOME/ivy/ivy.xml 去掉如下注释,启用 gora-hbase:

    <!-- Uncomment this to use HBase as Gora backend. -->
    <dependency org="org.apache.gora" name="gora-hbase" rev="0.3" conf="*->default" />

    2.4 创建  $NUTCH_HOME/conf/gora.properties ,添加如下内容:

    gora.datastore.default=org.apache.gora.hbase.store.HBaseStore

    2.5 编译

    #cd  nutch根目录
    ant runtime

    2.6 其他配置

    如果编译过程比较长,建议修改ivy中配置的maven仓库地址,具体方法: $NUTCH_HOME/ivy/ivysettings.xml 找到如下代码:

    <property name="repo.maven.org"
        value="http://repo1.maven.org/maven2/"
        override="false"/>

    把默认的maven中央库地址 http://repo1.maven.org/maven2/ 替换成国内OSC提供的镜像: http://maven.oschina.net/content/groups/public/

    如果编译过程中有如下错误提示:

    Trying to override old definition of task javac
      [taskdef] Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found.
    
    ivy-probe-antlib:
    
    ivy-download:
      [taskdef] Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found.

    是因为缺少lib包,解决办法如下:

    • 下载  sonar-ant-task-2.1.jar ,将其拷贝到 $NUTCH_HOME/lib 目录下面
    • 修改 $NUTCH_HOME/build.xml ,引入上面添加的jar包:
      <!-- Define the Sonar task if this hasn't been done in a common script -->
       <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
        <classpath path="${ant.library.dir}" />
        <classpath path="${mysql.library.dir}" />
        <classpath><fileset dir="lib/" includes="sonar*.jar" /></classpath>
       </taskdef>

    编译过程停止原因:

    Run the build on a machine connected to the internet. Ivy will cache your build's dependencies here (by default):

    $HOME/.ivy2/cache

    A populated cache will enable you to repeat the build inside your firewall.

    [三]、参考文章

  • 相关阅读:
    PHP7.27: connect mysql 5.7 using new mysqli
    PHP: Browser, Operating System (OS), Device, and Language Detect
    PHP 在WIN10 下配置
    MySQL chartset
    學習Echart 2.2.7
    The open source JavaScript graphing library that powers Plotly
    D3.js 制作中国地图
    FastReport.Net
    CSS 3D transforms
    SparkCore的调优之开发调优
  • 原文地址:https://www.cnblogs.com/timssd/p/5102816.html
Copyright © 2020-2023  润新知