`

windows下solr6的solrcloud使用

    博客分类:
  • Solr
阅读更多

solr版本:solr-6.0.1

本地启动solr的集群,根据官方手册指导执行以下命令

D:\solr-6.0.1\bin>solr.cmd -e cloud

该命令将默认启动两个端口的solr实例,8983,7574,同时启动内置的zookeeper服务,默认端口为9983.

控制台输出信息:

Welcome to the SolrCloud example!

This interactive session will help you launch a SolrCloud cluster on your local

workstation.

To begin, how many Solr nodes would you like to run in your local cluster? (spec

ify 1-4 nodes) [2]:        

Ok, let's start up 2 Solr nodes for your example SolrCloud cluster.

Please enter the port for node1 [8983]:

Please enter the port for node2 [7574]:

接着自动创建两个节点,其路径为:

Creating Solr home directory D:\solr-6.0.1\example\cloud\node1\solr

Cloning D:\solr-6.0.1\example\cloud\node1 into  D:\solr-6.0.1\example\cloud\node2

节点启动命令为:

    Starting up Solr on port 8983 using command:

D:\solr-6.0.1\bin\solr.cmd start -cloud -p 8983 -s "D:\solr-6.0.1\example\cloud\node1\solr"

Waiting up to 30 to see Solr running on port 8983 

Starting up Solr on port 7574 using command:

D:\solr-6.0.1\bin\solr.cmd start -cloud -p 7574 -s "D:\solr-6.0.1\example\cloud\

node2\solr" -z localhost:9983

默认的分片值为2,每个分片2个节点

How many shards would you like to split gettingstarted into? [2]

2

How many replicas per shard would you like to create? [2]

2

创建solr配置,默认名称为:gettingstarted,配置文件可以从

basic_configs, data_driven_schema_configs, or sample_techproducts_configs [data_

driven_schema_configs]中选择,默认为data_driven_schema_configs

上传配置到zookeeper,其路径为:/configs/gettingstarted

可通过zk客户端脚本连接查看:

D:\zookeeper-3.4.8\bin>zkCli.cmd -server localhost:9983

[zk: localhost:9983(CONNECTED) 1] ls /configs/gettingstarted/

 

currency.xml         managed-schema       protwords.txt

solrconfig.xml       synonyms.txt         elevate.xml

configoverlay.json   stopwords.txt        lang

params.json

等待创建名为gettingstartedcollection

Creating new collection 'gettingstarted' using command:

http://localhost:8983/solr/admin/collections?action=CREATE&name=gettingstarted&n

umShards=2&replicationFactor=2&maxShardsPerNode=2&collection.configName=gettings

tarted

 

{

  "responseHeader":{

    "status":0,

    "QTime":17386},

  "success":{

    "127.0.0.1:8983_solr":{

      "responseHeader":{

        "status":0,

        "QTime":7119},

      "core":"gettingstarted_shard1_replica2"},

    "127.0.0.1:7574_solr":{

      "responseHeader":{

        "status":0,

        "QTime":7400},

      "core":"gettingstarted_shard1_replica1"}}}

完成后可以在浏览器输入http://localhost:8983/solr查看结果




 
 

为分片增加节点

D:\solr-6.0.1\example\cloud路径下创建node3\solr文件夹,复制D:\solr-6.0.1\server\solr下的solr.xml文件到node3\solr下,启动该节点实例:

D:\solr-6.0.1>bin\solr.cmd -cloud -s example\cloud\node3\solr -p 8987 -z localhost:9983

Waiting up to 30 to see Solr running on port 8987

Started Solr server on port 8987. Happy searching!

collection菜单中即可对分片添加活动节点,如图所示




 
 

添加后的结果为:




 
 

另外一个分片操作相同。

创建新的配置

上传配置文件到zookeeper,可以使用solrzkcli脚本,windows操作如下:新建名为test的配置,使用D:\solr-6.0.1\server\solr\configsets\basic_configs下的配置文件

D:\solr-6.0.1\server\scripts\cloud-scripts>zkcli.bat -cmd upconfig -zkhost local

host:9983 -confname test -confdir ..\..\solr\configsets\basic_configs\conf

执行命令后,新建名为test的配置

[zk: localhost:9983(CONNECTED) 3] ls /configs/test

[currency.xml, managed-schema, protwords.txt, solrconfig.xml, synonyms.txt, stop

words.txt, _rest_managed.json, lang]

新建collection,如图




 
 

         创建成功后如下:

 




 
 

  • 大小: 46 KB
  • 大小: 58.9 KB
  • 大小: 11.5 KB
  • 大小: 25.9 KB
  • 大小: 2.6 KB
分享到:
评论

相关推荐

    solrcloud windows 环境搭建

    在Windows环境下搭建SolrCloud环境涉及多个步骤,包括Zookeeper集群的配置、Solr的部署和配置等。通过上述详细介绍,读者应能够理解SolrCloud的工作原理及其实现过程,从而在实际项目中有效利用其强大的分布式搜索...

    最新版windows solr-8.8.2.zip

    6. **Cloud模式**:在Solr 8.8.2中,SolrCloud模式允许在Zookeeper协调下进行集群管理,实现动态分片和故障恢复。 7. **搜索功能**:Solr支持丰富的查询语法,如标准查询解析器、布尔操作符、通配符查询、短语匹配...

    solrCloud5.2.1 + tomcat7 + zookeeper3.4.6

    在完成上述步骤后,你就成功地在Windows 7环境下搭建了一个SolrCloud的基本架构,能够支持多个Solr实例在单台机器上同时运行,这为后续的分布式搜索和索引管理提供了基础。接下来,你可能还需要配置Zookeeper集群,...

    windows版本的单机solr

    如果希望以服务模式运行,可以使用`bin\solr start -e cloud`命令,这将启动SolrCloud模式,适合分布式部署。启动完成后,你可以通过浏览器访问`http://127.0.0.1:8090/solr`来查看Solr管理界面,验证是否成功启动。...

    最新版windows solr-8.9.0.zip

    - 解压下载的zip文件后,可以在Windows上启动Solr服务器,通常通过运行`bin\solr start -e cloud`命令来创建一个简单的SolrCloud集群。 - 使用Solr的Admin UI(默认端口8983)进行配置和管理,包括创建、上传和...

    最新版windows solr-8.10.0.zip

    配置文件通常位于`server\solr\configsets`目录下,可以定制索引和查询行为。 3. **核心(Core)概念**:Solr中的“核心”是处理特定数据集的基本单位。用户可以通过管理界面或命令行工具创建、删除和管理核心,每...

    解决solr启动404问题

    Solr通常通过Java命令行启动,使用`solr.cmd`(Windows)或`bin/solr`(Linux/Mac)脚本。这些脚本会加载`solr.in.sh`或`solr.in.cmd`环境变量,并调用Java运行时执行`start.jar`。Solr的核心配置文件是`solrconfig....

    最新版windows solr-8.5.1.zip

    在Windows环境下安装和使用Solr 8.5.1版本,我们可以从以下几个方面来理解其核心知识点: 1. **Solr介绍**:Solr是一款开源的搜索平台,它支持多种格式的数据,如XML、JSON、CSV等,具有分布式、可扩展性、高可用性...

    最新版windows solr-8.6.1.zip

    此压缩包“最新版windows solr-8.6.1.zip”包含了在Windows环境下运行Solr 8.6.1版本所需的所有组件。 在Windows上安装和运行Solr 8.6.1,你需要遵循以下步骤: 1. **解压文件**:首先,你需要将下载的zip文件解压...

    最新版windows solr-8.8.0.zip

    对于开发人员来说,使用Windows Solr 8.8.0意味着可以利用Windows平台的便利性来部署和管理Solr服务。安装和配置过程相对简单,通过提供的压缩包解压后,可以直接启动Solr服务器。同时,Windows环境中的日志管理和...

    solr 部署在linux windows环境

    5. **配置和使用**:Windows下的配置过程与Linux类似,只是路径和命令有所不同。 **三、Solr核心和索引** 1. **Solr核心**:Solr的核心是处理数据的基本单位,每个核心可以有自己的配置和索引。你可以通过Solr管理...

    最新版windows solr-8.7.0.zip

    最新版Windows Solr 8.7.0是一个专为在Windows环境下运行优化的版本,包含了Solr的核心功能以及针对Windows平台的特殊配置。 在Solr 8.7.0中,有几个关键知识点值得一提: 1. **分布式搜索**:Solr 8.7.0支持多...

    最新版windows solr-8.6.0.zip

    在Windows环境下部署Solr,可以方便地进行数据索引、搜索以及数据分析。"最新版windows solr-8.6.0.zip"是针对Windows用户提供的Solr 8.6.0版本的安装包,包含了运行和配置Solr所需的所有组件。 1. **Solr的核心...

    solr 的使用及安装

    3. **启动 Solr**:在 Solr 的 bin 目录下,运行 `./solr start`(Linux/Mac)或 `bin\solr.cmd start`(Windows)启动 Solr 服务器。 三、创建核心(Core) Solr 中的核心是数据处理的基本单元,每个核心对应一个...

    window下tomcat+solr整合

    标题中的“window下tomcat+solr整合”指的是在Windows操作系统环境下,将Apache Tomcat(一个流行的Java Servlet容器)与Apache Solr(一个基于Lucene的全文搜索服务器)进行集成,以便实现高效的全文检索功能。...

    最新版windos solr-8.11.0.zip

    最新的版本为windos solr-8.11.0,专为Windows操作系统设计,提供了丰富的功能和优化,旨在提升在Windows环境下的性能。 在Solr 8.11.0版本中,主要包含了以下关键知识点: 1. **核心功能**:Solr的核心功能包括...

    solr-7.6.0-windows

    在Windows环境下安装和使用Solr,能够帮助用户快速构建高性能的搜索应用。这个压缩包"solr-7.6.0-windows"包含了Solr 7.6.0版本在Windows操作系统上的所有必要组件和配置文件,便于Windows用户进行本地开发和测试。 ...

    solr-7.4.0.zip

    1. `bin`目录:包含Solr的启动脚本,如`solr`和`solr.cmd`,分别用于Linux/Unix和Windows系统启动Solr服务器。 2. `server`目录:包含了Solr服务器的核心组件,如Jetty web服务器,Solr配置文件,以及SolrCloud相关...

Global site tag (gtag.js) - Google Analytics