solrCloud分布式集群部署(一)

10 篇文章 0 订阅

服务器IP:192.168.100.175

1个zookeeper + 2个tomcat(tomcat1, tomcat2)

模式:1个core,1个shard

最终效果实现:


配置zookeeper,conf/zoo.cfg:

# The number of milliseconds of each tick

tickTime=2000

# The number of ticks that the initial

# synchronization phase can take

initLimit=10

# The number of ticks that can pass between

# sending a request and getting an acknowledgement

syncLimit=5

# the directory where the snapshot is stored.

# do not use /tmp for storage, /tmp here is just

# example sakes.       

#设置zookeeperdata路径

dataDir=/opt/solrCloud/zookeeper-3.4.5/data

# the port at which the clients will connect

clientPort=9080

 

启动zookeeper: ./bin/zkServer.sh start

 

配置solr.xml

<coresadminPath="/admin/cores"defaultCoreName="collection1"

host="${host:192.168.100.175}"hostPort="${jetty.port:8080}"

hostContext="${hostContext:solr}"zkClientTimeout="${zkClientTimeout:15000}">

    <core name="collection1" instanceDir="collection1" />

</cores>

 

配置tomcat1:在tomcat1的bin/catalina.sh最上面增加:

JAVA_OPTS="

-Dbootstrap_confdir=/opt/solrCloud/tomcat1/solr/collection1/conf

-Dcollection.configName=clusterconf

 -Djetty.port=8080

 -Dhost=192.168.100.175

 -DzkRun

 -DzkHost=localhost:9080

-DnumShards=1"

注意:这边的修改会覆盖solr.xml中的配置。

 

启动tomcat1

 

配置tomcat2:

复制tomcat1一份为tomcat2:cp –r tomcat1/ tomcat2

修改tomcat2的端口为8081

修改solr.xml:

    <coresadminPath="/admin/cores"defaultCoreName="collection1"

host="${host:192.168.100.175}"hostPort="${jetty.port:8081}"

hostContext="${hostContext:solr}"zkClientTimeout="${zkClientTimeout:15000}">

    <core name="collection1" instanceDir="collection1" />

</cores>

 

修改bin/catalina.sh,在最上面增加:

JAVA_OPTS="-Djetty.port=8081

            -DzkHost=192.168.100.175:9080"

//注意:这边的修改会覆盖solr.xml中的配置。

 

启动tomcat2.

 

如果有问题需要重新配置,则需要删除zookeeper的数据文件。

OK,SUCCESS。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

sg_0504

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值