The configuration affecting replication is controlled by a single file, alfresco-search-services/solrhome/templates/re-rank/conf/solrconfig.xml. To configure the master server, follow the steps below:
-
Edit the alfresco-search-services/solrhome/templates/re-rank/conf/solrconfig.xml file on the master server to change the default replication handler configuration. Remember to uncomment the master section.
<requestHandlername="/replication"class="solr.ReplicationHandler" > <!-- To enable simple master/slave replication, uncomment one of the sections below, depending on whether this solr instance should be the "master" or a "slave". If this instance is a "slave" you will also need to fill in the masterUrl to point to a real machine. --> <lst name="master"> <str name="replicateAfter">commit</str> <str name="replicateAfter">startup</str> <str name="confFiles">schema.xml,stopwords.txt</str> </lst> <!-- <lst name="slave"> <str name="masterUrl">http://your-master-hostname:8983/solr</str> <str name="pollInterval">00:00:60</str> </lst> --> </requestHandler>
where:
Parameter Description replicateAfter String specifying action after which replication should occur. Valid values are, commitwhich triggers replication whenever a commit is performed on the master index,optimize which triggers replication whenever the master index is optimized and startup which triggers replication whenever the master index starts up. 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 future commits or optimizes. confFiles Comma-separated list of configuration files to replicate. -
Make sure that the solrcore.properties file has the following settings:
enable.master=true enable.slave=false