zoukankan      html  css  js  c++  java
  • Solr(六)Solr索引数据存放到HDFS下

    Solr索引数据存放到HDFS下

    一 新建solr core hdfs

      

    方法:http://www.cnblogs.com/Matchman/p/7287385.html

      

    二 修改solrconfig.xml文件

    文件地址:/usr/local/tomcat/apache-tomcat-8.5.13/solr_home/hdfs/conf/solrconfig.xml
    vi /usr/local/tomcat/apache-tomcat-8.5.13/solr_home/hdfs/conf/solrconfig.xml 

    1 将原文件中<directoryFactory>...</directoryFactory>配置修改成如下:

    <directoryFactory name="DirectoryFactory" class="solr.HdfsDirectoryFactory">
            <str name="solr.hdfs.home">hdfs://192.168.3.111:9000/news</str>
            <bool name="solr.hdfs.blockcache.enabled">true</bool>
            <int name="solr.hdfs.blockcache.slab.count">1</int>
            <bool name="solr.hdfs.blockcache.direct.memory.allocation">true</bool>
            <int name="solr.hdfs.blockcache.blocksperbank">16384</int>
            <bool name="solr.hdfs.blockcache.read.enabled">true</bool>
            <bool name="solr.hdfs.blockcache.write.enabled">true</bool>
            <bool name="solr.hdfs.nrtcachingdirectory.enable">true</bool>
            <int name="solr.hdfs.nrtcachingdirectory.maxmergesizemb">16</int>
            <int name="solr.hdfs.nrtcachingdirectory.maxcachedmb">192</int>
    </directoryFactory>

    (注):solr.hdfs.home中配置的为Hadoop的HDFS的访问路劲

    2 将原文件中<<lockType>>...</<lockType>>配置修改成如下:

    <lockType>${solr.lock.type:hdfs}</lockType>

    三 替换Jar包

    1 从Hadoop中获取以下四个jar包

    hadoop-2.6.5/share/hadoop/common/hadoop-common-2.6.5.jar
    hadoop-2.6.5/share/hadoop/hdfs/hadoop-hdfs-2.6.5.jar
    hadoop-2.6.5/share/hadoop/common/lib/hadoop-auth-2.6.5.jar
    hadoop-2.6.5/share/hadoop/common/lib/hadoop-annotations-2.6.5.jar
    

    2 下载protobuf-java-2.5.0.jar包

    下载地址:http://download.csdn.net/download/u013292160/9936638
    

    3 删除Jar包

    目录:/usr/local/tomcat/apache-tomcat-8.5.13/webapps/solr/WEB-INF/lib
    rm hadoop-*.jar
    rm protobuf-java-2.5.0.jar 
    

    4上传Jar包

    将Hadoop中获取的四个Jar包和下载的Jar包上传

    四 重启tomcat访问Solr客户端

     cd /usr/local/tomcat/apache-tomcat-8.5.13/bin/
    
     ./startup.sh 
    

  • 相关阅读:
    BZOJ 1977: [BeiJing2010组队]次小生成树 Tree( MST + 树链剖分 + RMQ )
    BZOJ 2134: 单选错位( 期望 )
    BZOJ 1030: [JSOI2007]文本生成器( AC自动机 + dp )
    BZOJ 2599: [IOI2011]Race( 点分治 )
    BZOJ 3238: [Ahoi2013]差异( 后缀数组 + 单调栈 )
    ZOJ3732 Graph Reconstruction Havel-Hakimi定理
    HDU5653 Bomber Man wants to bomb an Array 简单DP
    HDU 5651 xiaoxin juju needs help 水题一发
    HDU 5652 India and China Origins 并查集
    HDU4725 The Shortest Path in Nya Graph dij
  • 原文地址:https://www.cnblogs.com/Matchman/p/7373968.html
Copyright © 2011-2022 走看看