On 8/5/22 07:00, Thomas Woodard wrote:
   <requestHandler name="/replication" class="solr.ReplicationHandler">
     <lst name="leader">
       <str name="replicateAfter">optimize</str>
       <str name="backupAfter">optimize</str>
     </lst>
     <int name="maxNumberOfBackups">2</int>
     <str name="commitReserveDuration">00:00:20</str>
     <str name="location">/var/i8s/backup/solr/${i8s.environment}/${
solr.core.name}</str>
   </requestHandler>

The backups after optimize are happening, but they are going to the default
locations, not the configured location. For example:
2022-08-04 17:19:52.053 INFO  (Thread-14) [   ] o.a.s.h.SnapShooter
Creating backup snapshot <not named> at
file:///var/solr/data/contentPage/data/

I've confirmed that it isn't a path security issue, by verifying that all
paths are allowed:
2022-08-05 12:29:03.873 INFO  (main) [   ] o.a.s.c.CoreContainer Allowing
use of paths: [_ALL_]

https://solr.apache.org/guide/8_11/index-replication.html#http-api-commands-for-the-replicationhandler

This appears to be some relevant info on that page:

 *

   |location|: Backup location. Value depends on the repository in use.
   For file system repository, location defaults to core’s dataDir, and
   if specified, it needs to be within|SOLR_HOME|,|SOLR_DATA_HOME|or
   the paths specified by solr.xml|allowPaths|.


I am not sure that you can put "location" in solrconfig.xml ... the reference guide lists it as a URL parameter, not a configuration parameter.  I have not verified this.

Once you work out whether it needs to be a URL parameter: For security purposes, Solr limits where it can write data that is triggered by API calls.  If you want it to be outside of SOLR_HOME or SOLR_DATA_HOME then you have to allow the path in solr.xml.

https://solr.apache.org/guide/8_11/format-of-solr-xml.html#the-solr-element

Thanks,
Shawn

Reply via email to