SOLR distributed deployment

Source: Internet
Author: User
Tags solr

The SOLR replication mode is an implementation method used to synchronize master-slave servers in a distributed environment. Because the deployment cost of the rsync-based SOLR is too high, replaced by solr1.4, it is replaced by an HTTP-based index file transfer mechanism. This method is easy to deploy and requires only one file.

The procedure is as follows:

The steps are divided into the master server and slave server. Multiple slave servers are allowed, that is, the configuration of the slave server is the same.

Master Server:

 

In solrconfig. XML, find the following line:

<Requesthandler name = "/replication" class = "SOLR. replicationhandler">

  1. <Lst name = "master">
  2. <STR name = "replicateafter"> commit </STR>
  3. <STR name = "conffiles"> schema.xml,stopwords.txt, elevate. xml </STR>
  4. <STR name = "commitreserveduration"> 00:05:00 </STR>
  5. <STR name = "httpbasicauthuser"> 123 </STR>
  6. <STR name = "httpbasicauthpassword"> 123 </STR>
  7. </Lst>
  8. </Requesthandler>

 

Note:

  • Replicateafter: SOLR will perform a copy after the following operations occur: 'commit ', 'startup' 'optimize'. Here we choose commit, that is, after SOLR receives a commit request every time, the replication policy is executed.
  • Conffiles: the configuration file to be distributed. SOLR also synchronizes the field configuration files schema.xmland stopwords.txt on the master server, and the solid partition file: elevate. XML to the slave server.
  • Commitreserveduration: the cycle time for retaining the incremental index after each commit. Set this parameter to 5 minutes.

Slave Server

<Requesthandler name = "/replication" class = "SOLR. replicationhandler">

  1. <Lst name = "slave">
  2. <STR name = "masterurl"> http: // localhost: Port/SOLR/corename/replication </STR>
  3. <STR name = "pollinterval"> 00:05:00 </STR>
  4. <STR name = "compression"> internal </STR>
  5. <STR name = "httpconntimeout"> 5000 </STR>
  6. <STR name = "httpreadtimeout"> 10000 </STR>
  7. <STR name = "httpbasicauthuser"> 123 </STR>
  8. <STR name = "httpbasicauthpassword"> 123 </STR>
  9. </Lst>
  10. </Requesthandler>

 

Note:

  • Masterurl: synchronization URL of the master server
  • Pollinterval: The slave server synchronization interval, that is, the interval at which the master server Synchronizes time.
  • Httpconntimeout: sets the connection timeout (unit: milliseconds)
  • Httpreadtimeout: If the synchronization index file is too large, increase this value as appropriate. (Unit: milliseconds)
  • Httpbasicauthuser: the authentication username, which must be consistent with the master server
  • Httpbasicauthpassword: The verification password, which must be consistent with the master server
  • Compression: external or internal uses SOLR's own compression algorithm or application container's

Difference: the internal algorithm will greatly increase the synchronization cost. original statement: use this only if your bandwidth is low. This can actually slowdown replication in a LAN.

Therefore, we recommend that you use the external method: external.

At the same time, you need to configure the external application container: Take Tomcat as an example:


  1. <Connector compression = "on"
  2. Compressablemimetype = "text/html, text/XML, text/plain"
  3. Compressionminsize = "2048" type = "parmname" text = "parmname"/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.