Solr7.3安装

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/h1059141989/article/details/80914328

(一)下载并解压Apache Solr

Solr7.3.0下载

(二)在SolrCloud模式下启动Solr

进入到Solr文件夹的根目录下

  • 在Unix或MacOS或Linux上运行
bin/solr start -e cloud
  • 在Windows上运行
bin\solr.cmd start -e cloud
  • cloud设置
E:\solr-7.3.0>bin\solr.cmd start -e cloud

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? (specify 1-4 nodes) [2]:

第一个提示问我们要运行多少个节点。注意最后一行的末尾的[2],这是默认的节点数量。直接选择[enter]

Ok, let's start up 2 Solr nodes for your example SolrCloud cluster.
Please enter the port for node1 [8983]:

这里是第一个节点运行的端口。除非机器上的8983端口被占用,否则也可以选择接受此默认选项[enter]

Please enter the port for node2 [7574]:

同上,是第二个节点的端口。

Solr home directory E:\solr-7.3.0\example\cloud\node1\solr already exists.
E:\solr-7.3.0\example\cloud\node2 already exists.

Starting up Solr on port 8983 using command:
"E:\solr-7.3.0\bin\solr.cmd" start -cloud -p 8983 -s "E:\solr-7.3.0\example\cloud\node1\solr"

Waiting up to 30 to see Solr running on port 8983
Started Solr server on port 8983. Happy searching!

Starting up Solr on port 7574 using command:
"E:\solr-7.3.0\bin\solr.cmd" start -cloud -p 7574 -s "E:\solr-7.3.0\example\cloud\node2\solr" -z localhost:9983

Waiting up to 30 to see Solr running on port 7574
Started Solr server on port 7574. Happy searching!
INFO  - 2018-07-04 15:17:35.349; org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider; Cluster at localhost:9983 ready

因为之前启动过,所以提示solr,node2 文件夹已经存在。
请注意,Solr的两个实例已在两个节点上启动。因为我们从SolrCloud模式开始,并没有定义任何关于外部ZooKeeper集群的细节,Solr启动它自己的ZooKeeper并将两个节点连接到它。

启动完成后,系统将提示您创建用于索引数据的集合。

Now let's create a new collection for indexing documents in your 2-node cluster.
Please provide a name for your new collection: [gettingstarted]

这是我们偏离默认选项的第一个地方。在提示符处输入techproducts并[enter]

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

这是询问我们想要在两个节点之间分割索引的发片数量,选择[2] (默认值)意味着我们将在两个节点之间相对均匀的拆分索引。

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

副本是用于故障转移索引的,这里同样可以选择默认的[2]

Please choose a configuration for the techproducts collection, available options are:
_default or sample_techproducts_configs [_default]

我们已经达到了另一个我们会偏离默认选项的地步。Solr有两套可用的配置文件(称为configSet)。

一个集合必须有一个configSet,它至少包含Solr的两个主要配置文件:模式文件(命名为managed-schemaor或schema.xml)和solrconfig.xml。这里的问题是你想从哪个configSet开始。这_default是一个简单的选项,但请注意,其中一个名称包含“techproducts”,与我们命名为我们的集合相同。这个configSet专为支持我们想要使用的示例数据而设计,因此请在提示符处输入sample_techproducts_configs并点击[enter]

至此,Solr已经准备好数据了。
访问以下两个链接都可以进入solr管理页面
http://localhost:7574/solr/
http://localhost:8983/solr/

猜你喜欢

转载自blog.csdn.net/h1059141989/article/details/80914328
今日推荐