Solr Jetty Replication

===========================================================
How to build a Solr cluster(One Master, two Slaves)
===========================================================
1. Add below replication handler to solrconfig.xml in the example dir.
<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="master">
<str name="enable">${solr.master.enable:false}</str>
<str name="replicateAfter">startup</str>
<str name="replicateAfter">commit</str>
<str name="confFiles">stopwords.txt</str>
</lst>
<lst name="slave">
<str name="enable">${solr.slave.enable:false}</str>
<str name="masterUrl">
http://SOLRSERVER:8983/solr/collection1/replication
</str>
<str name="pollInterval">00:00:60</str>
</lst>
</requestHandler>
2.
cp -r example example2
cp -r example example3

3.start the servers
cd example -- this is for master
nohup java -Xms512M -Xmx1024M -Dfile.encoding=UTF8 -Dsolr.master.enable=true -jar start.jar &

cd example2 -- this is for slave
nohup java -Xms512M -Xmx1024M -Dfile.encoding=UTF8 -Dsolr.slave.enable=true -Dsolr.data.dir=./cores_data/data8984 -Djetty.port=8984 -jar start.jar &

cd example3 -- this is for slave
nohup java -Xms512M -Xmx1024M -Dfile.encoding=UTF8 -Dsolr.slave.enable=true -Dsolr.data.dir=./cores_data/data8985 -Djetty.port=8985 -jar start.jar &

4 check ths status
http://SOLRSERVER:8983/solr/admin/replication/index.jsp
http://SOLRSERVER:8984/solr/admin/replication/index.jsp
http://SOLRSERVER:8985/solr/admin/replication/index.jsp

5. build index into server.
[jk97029@SOLRSERVER exampledocs]$ pwd
/home/jk97029/apache-solr-3.6.0/example/exampledocs
[jk97029@SOLRSERVER exampledocs]$ java -jar post.jar mem.xml
[jk97029@SOLRSERVER exampledocs]$ java -jar post.jar hd.xml

6. check if the docs are added or not.
http://SOLRSERVER:8983/solr/select/?q=id:6H500F0
http://SOLRSERVER:8984/solr/select/?q=id:6H500F0
http://SOLRSERVER:8985/solr/select/?q=id:6H500F0
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值