zoukankan      html  css  js  c++  java
  • SolrCloud应用简介

    1、windows下启动实例工程

    官网下载solr后解压到本地硬盘,在sol/bin目录下打开命令行窗口,然后测试以下命令:

    solr -e cloud 启动例子中的solrcould,进入交互界面,会让你输入创建的node数(默认2个),要绑定的端口,以及创建collection名称等,基本都默认即可。若想直接用默认的值创建这个工程实例直接输入命令:solr -e cloud -noprompt;
    solr start -cloud -s example/cloud/node1/solr -p 8983 通过-s命令指定要启动的实例名
    solr status 显示实例状态
    solr healthcheck -c gettingstarted 检查solrcould实例gettingstarted 的健康状态;
    solr stop -all 停止所有的solr实例
    solr restart -c -p 8983 -s example/cloud/node1/solr 重启实例node1;

    solr restart -c -p 7574 -z localhost:9983 -s example/cloud/node2/solr 重启实例node2,增加-z选项,是为了和node1绑定在一个集群上,否则若没有-z选项默认该node会绑定solr端口+1000即8574上;

    https://cwiki.apache.org/confluence/display/solr/Getting+Started+with+SolrCloud

    2、更新配置文件

    在使用DIH时需要自己配置solrconfig.xml,data-config.xml,schema.xml几个配置文件,solr自带的实例是独立模式运行下的,其中的配置文件默认是在core里的conf文件夹下;而solrcould的配置文件是保存在zookeeper中的,要使用DIH导入数据必须要更新配置文件。

    上面命令solr -e cloud执行时,会自动把默认配置集下的data_driven_schema_configs目录上传到zookeeper中并关联到默认的collection中。

    solr create -c mycollection -d data_driven_schema_configs 命令会创建一个名字为mycollection的collection,并且上传-d指定的data_driven_schema_configs文件到zookeeper中并与mycollection关联;

    对于已经有配置文件的collection可以通过zkcli or SolrJ更新配置文件;以zkcli为例:zkcli.bat -cmd upconfig -zkhost  <host:port> -confname <name for configset> -solrhome <solrhome> -confdir <path to directory with configset>

    https://cwiki.apache.org/confluence/display/solr/Using+ZooKeeper+to+Manage+Configuration+Files

    https://cwiki.apache.org/confluence/display/solr/Command+Line+Utilities

  • 相关阅读:
    携程的 Dubbo 之路
    应用上云新模式,Aliware 全家桶亮相杭州云栖大会
    重构:改善饿了么交易系统的设计思路
    Arthas 3.1.2 版本发布 | 增加 logger/heapdump/vmoption 命令
    如何检测 Web 服务请求丢失问题
    VPGAME的Kubernetes迁移实践
    Flink SQL 系列 | 5 个 TableEnvironment 我该用哪个?
    如何构建批流一体数据融合平台的一致性语义保证?
    Flink on YARN(下):常见问题与排查思路
    愚蠢的操作
  • 原文地址:https://www.cnblogs.com/doit8791/p/4896243.html
Copyright © 2011-2022 走看看