搭建SolrCloud 环境

Solr 5.0之前都是借助于tomcat启动,5.1后可以自己是一个服务使用,不用借助于tomcat。

Solr可以运行在两种模式:“Cloud” mode or “Standalone” mode。

SolrCloud mode下,可以创建collections,而在Standalone mode下,只能创建core。

最近复现漏洞,需要Solr以SolrCloud模式启动,查阅了一些博客和资料,都是需要安装、复制tomcat、zookeeper等多种软件,甚是麻烦。

后来翻到@giserinchina 的博客《Solr学习笔记(1):Solr 8.1.0 安装(启动cloud)》,发现原来可以这样,深感知识浅薄及文档阅读能力不足,特此记录。

详细可参考:

https://lucene.apache.org/solr/guide/7_7/getting-started-with-solrcloud.html#getting-started-with-solrcloud

https://blog.csdn.net/wxb880114/article/details/90407203

1、下载solr:https://archive.apache.org/dist/lucene/solr/8.1.0/solr-8.1.0.tgz

2、解压:tar -zxvf  solr-8.1.0.tgz

3、启动solr,两种方式

    a) standlone模式:bin/solr start        启动单机版

    b) Cloud模式:bin/solr start -cloud        启动分布式版本

    可以加上-force

在solr目录的bin目录下,启动solr:

 solr-8.1.0/bin/solr start -e cloud -force

*** [WARN] *** Your open file limit is currently 1024.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] ***  Your Max Processes Limit is currently 15061.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh

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
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 /data/soft/solr-8.1.0/example/cloud/node1/solr
Cloning /data/soft/solr-8.1.0/example/cloud/node1 into
   /data/soft/solr-8.1.0/example/cloud/node2

Starting up Solr on port 8983 using command:
"/data/soft/solr-8.1.0/bin/solr" start -cloud -p 8983 -s "solr-8.1.0/example/cloud/node1/solr" -force

*** [WARN] *** Your open file limit is currently 4096.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] ***  Your Max Processes Limit is currently 15061.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
NOTE: Please install lsof as this script needs it to determine if Solr is listening on port 8983.

Started Solr server on port 8983 (pid=19474). Happy searching!


Starting up Solr on port 7574 using command:
"/data/soft/solr-8.1.0/bin/solr" start -cloud -p 7574 -s "solr-8.1.0/example/cloud/node2/solr" -z localhost:9983 -force

*** [WARN] *** Your open file limit is currently 4096.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] ***  Your Max Processes Limit is currently 15061.
 It should be set to 65000 to avoid operational disruption.
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
NOTE: Please install lsof as this script needs it to determine if Solr is listening on port 7574.

Started Solr server on port 7574 (pid=19602). Happy searching!

INFO  - 2020-10-14 14:06:35.435; org.apache.solr.common.cloud.ConnectionManager; zkClient has connected
INFO  - 2020-10-14 14:06:35.461; org.apache.solr.common.cloud.ZkStateReader; Updated live nodes from ZooKeeper... (0) -> (2)
INFO  - 2020-10-14 14:06:35.485; org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider; Cluster at localhost:9983 ready

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

成功启动Solr Cloud模式

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值