Feeds:
Posts
Comments

Archive for the ‘Solr – Apache’ Category

Java based replication is implemented as RequestHandler. Using single solrconfig.xml for master and slave.

changes in solrconfig.xml

${enable.master:false}
commit
startup
schema.xml,stopwords.txt,elevate.xml
00:00:20
optimize

${enable.slave:false}
http://192.168.1.120:8983/solr/replication
00:00:60
internal
5000
10000
username
password


Tag description:

Master

enable

If a server needs to be turned into a master from a slave or if you wish to use the same solrconfig.xml for both master and slave. When the master is started, pass in -Denable.master=true and in the slave pass in -Denable.slave=true

replicateAfter

Replicate on give value. Valid values are “commit”, “startup”, “optimize”. You can give multiple values. If only the startup option is given, replication will not be triggered on subsequent commits/optimizes after it is done for the first time at the start.

confFiles

Configuration files names mentioned will be replicated. The files that are to be replicated have to be mentioned explicitly in using the ‘confFiles’ parameter. Only files in the ‘conf’ dir of the solr instance are replicated. The files are replicated only along with a fresh index.

commitReserveDuration

If your commits are very frequent and network is particularly slow, you can tweak an extra attribute 00:00:20. Default is 10 secs.

backup

Create a backup after action specified in backupAfter. Valid values are ‘optimize’, ‘commit’, ‘startup’. It is possible to have multiple entries of this config string. Note that this is just for backup, replication does not require this.

Slave

enable

Same as of master. pass in -Denable.slave=true to run the solr in slave mode.

masterUrl

Master apache solr server url.

pollInterval

Interval in which the slave should poll master .Format is HH:mm:ss . If this is absent slave does not poll automatically. But a fetchindex can be triggered from the admin or the http API

compression

The possible values are internal|external if the value is ‘external’ make sure that your master Solr has the settings to honour the accept-encoding header. If it is ‘internal’ everything will be taken care of automatically. Use this only if you bandwidth is low

httpConnTimeout/httpReadTimeout

The following values are used when the slave connects to the master to download the index files. Default values implicitly set as 5000ms and 10000ms respectively. The user DOES NOT need to specify these unless the bandwidth is extremely low or if there is an extremely high latency.

httpBasicAuthUser/httpBasicAuthPassword

If HTTP Basic authentication is enabled on the master we need to specify these parameters other not.

Just copy the above xml fragment to solrconfig.xml

Starting apache solr in master mode.

$ java -jar -Dmaster.enable=true start.jar

Starting apache solr in slave mode

$ java -jar -Dslave.enable=true start.jar

For More information please refer :

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

Read Full Post »