replicateAfter String specifying action after which replication should occur. Valid values are commit,optimize,or startup. There can be multiple values for this parameter. If you use "startup",you need to have a "commit" and/or "optimize" entry also if you want to trigger replication on futures commits or optimizes.
salve pollInterval
The master is totally unaware of the slaves. The slave continuously keeps polling the master (depending on thepollIntervalparameter) 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:
- The slave issues afilelistcommand to get the list of the files. This command returns the names of the files as well as some Metadata (for example,size,a lastmodified timestamp,an alias if any).
- The slave checks with its own index if it has any of those files in the local index. It then runs the filecontent command to download the missing files. 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,the slave tries 5 times before giving up a replication altogether.
- The files are downloaded into a temp directory,so that if either the slave or the master crashes during the download process,no files will be corrupted. Instead,the current replication will simply abort.
- After the download completes,all the new files are 'mov'ed to the live index directory and the file's timestamp is same as its counterpart in on the master master.
- A commit command is issued on the slave by the Slave's ReplicationHandler and the new index is loaded.
confFiles
To replicate configuration files,list them using using theconfFilesparameter. Only files found in theconfdirectory of the master's Solr instance will be replicated
Solr replicates configuration files only when the index itself is replicated. That means even if a configuration file is changed on the master,that file will be replicated only after there is a new commit/optimize on master's index.
Unlike the index files,where the timestamp is good enough to figure out if they are identical,configuration files are compared against their checksum. Theschema.xmlfiles (on master and slave) are judged to be identical if their checksums are identical.
As a precaution when replicating configuration files,Solr copies configuration files to a temporary directory before moving them into their ultimate location in the conf directory. The old configuration files are then renamed and kept in the sameconf/directory. The ReplicationHandler does not automatically clean up these old files.
If a replication involved downloading of at least one configuration file,the ReplicationHandler issues a core-reload command instead of a commit command.