Setup Replication in Solr

 

How does the slave replicate?

http://wiki.apache.org/solr/SolrReplication

The master is totally unaware of the slaves. The slave continuously keeps polling the master (depending on the 'pollInterval' parameter) to check the current index version the master. If the slave finds out that the master has a newer version of the index it initiates a replication process. The steps are as follows,

  • Slave issues a filelist command to get the list of the files . This command returns the names of the files as well as some metadata (size,lastmodified,alias if any)
  • The slave checks with its own index if it has any of those files in the local index . It then proceeds to download the missing files (The command name is 'filecontent' ). This uses a custom format (akin to the HTTP chunked encoding) to download the full content or a part of each file. If the connection breaks in between , the download resumes from the point it failed. At any point, it tries 5 times before giving up a replication altogether.
  • The files are downloaded into a temp dir . So if the slave or master crashes in between it does not corrupt anything. It just aborts the current replication.
  • After the download completes, all the new files are 'mov'ed to the slave's live index directory and the files' timestamps will match the timestamps in the master.
  • A 'commit' command is issued on the slave by the Slave's ReplicationHandler and the new index is loaded.

Step by Step To Setup Replication: (from envykok)

1. Config master and slave solrconfig.xml



2. Compare the index files before commit


3. Restart apache server

4. Check admin/replication page for master and slave





5. Run commit in master


6. Compare the index files after commit



 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值