• Linux中solr及solr集群的搭建


    单机版:

    1 将solr的jar包导入Linux 并进行解压 tar -zxvf solr-4.10.3.tgz.tgz

    2 进入文件 cd solr-4.10.3/bin 运行solr ./solr start -p 8080 ps -ef|grep solr 查看solr进行是否存在

    3 测试是否能运行 本地LinuxIP:8080/solr

    4 如果能运行 关闭solr ./solr stop -p 8080 需按照需求配置配置文件 将分词器 IKAnalyzer2012FF_u1.jar 放入solr文件夹下的example/solr-webapp/webapp/WEB-INF/lib

    在WEB-INF下创建classes文件夹

    将分词器的配置文件 mydict.dic ext_stopword.dic IKAnalyzer.cfg.xml 放入solr文件夹下的example/solr-webapp/webapp/WEB-INF/classes

    5

    修改Solr下的schema.xml文件,添加FieldType:

    vim /usr/local/solr-4.10.3/exammple/solr/collection1/conf/schema.xml

    将下列文件添加至此配置文件中

    <fieldType name="text_ik" class="solr.TextField">
    <analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/>
    </fieldType>

    <field name="item_title" type="text_ik" indexed="true" stored="true"/>
    <field name="item_sell_point" type="text_ik" indexed="true" stored="true"/>
    <field name="item_price" type="long" indexed="true" stored="true"/>
    <field name="item_image" type="string" indexed="false" stored="true" />
    <field name="item_category_name" type="string" indexed="true" stored="true" />
    <field name="item_desc" type="text_ik" indexed="true" stored="false" />

    <field name="item_keywords" type="text_ik" indexed="true" stored="false" multiValued="true"/>
    <copyField source="item_title" dest="item_keywords"/>
    <copyField source="item_sell_point" dest="item_keywords"/>
    <copyField source="item_category_name" dest="item_keywords"/>
    <copyField source="item_desc" dest="item_keywords"/>

    保存退出

    5 进入solr下的bin目录 运行solr ./solr start -p 8080

    6 测试是否能运行 本地LinuxIP:8080/solr

    solrCloud solr集群
    在/usr/local下 创建文件夹 solrCloud
    将配置完整的solr-4.10.3复制三份 放入solrCloud 名字为 solr01 solr02 solr03
    分别在三个文件下执行
    ./solr01/bin/solr start -c -z zookeeper的IP地址:2181 -p 自定义端口
    测试是否连得通 
    本地LinuxIP:8080/solr 点击页面左边列表中的Greph 查看是否成功

  • 相关阅读:
    Eclipse用法与技巧——导入工程时报错(already exist in the workspace)
    小F的2013应届校招历程小结
    java知识积累——单元测试和JUnit(二)
    vue 中的 .sync 修饰符 与 this.$emit('update:key', value)
    vue 中的 provide/inject
    2011/08/27 刷机器,遭遇白苹果,不可连接ipod服务器 的解决
    传输文件过程中遇到异常被中断
    窗体的置顶显示
    将截图图片放入内存(剪贴板)中
    WPF加载相对路径的图片的解决方法
  • 原文地址:https://www.cnblogs.com/ITniuniu/p/9257618.html
Copyright © 2020-2023  润新知