Skip to content

Commit

Permalink
Refine default Solr config settings post external Solr transition
Browse files Browse the repository at this point in the history
Deprecated irrelevant :solr_home_directory.
Updated solr_url comment to be more appropriate.
Set no. of backups to 0 by default. Since external transition the
snapshot feature wouldn't work without cfg updates anyway and it's
now more difficult to assume there's a standard deployment config
for Solr backups that will be generally applicable.
Set :solr_index_directory to a reasonable looking "default" should
backups be enabled.
Abort the snapshot if the :solr_index_directory is not found.
Remove embedded Solr checkindex scripts.
  • Loading branch information
mark-cooper committed Mar 10, 2022
1 parent 97ef868 commit 57ae667
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 126 deletions.
3 changes: 0 additions & 3 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@
<copy file="../indexer/indexer.war" todir="target/archivesspace/wars" />
<copy file="../oai/oai.war" todir="target/archivesspace/wars" />
<copy file="scripts/migrate_db.rb" todir="target/archivesspace/scripts/rb" />
<copy file="scripts/checkindex.rb" todir="target/archivesspace/scripts/rb" />
<!-- bundler -->
<copy todir="target/archivesspace/gems">
<fileset dir="gems" excludes="jruby/**" />
Expand Down Expand Up @@ -400,8 +399,6 @@
<zipfileset dir="../launcher/scripts" includes="find-base.sh" prefix="archivesspace/scripts" filemode="755" />
<zipfileset dir="../launcher/scripts" includes="setup-database.sh" prefix="archivesspace/scripts" filemode="755" />
<zipfileset dir="../launcher/scripts" includes="setup-database.bat" prefix="archivesspace/scripts" filemode="755" />
<zipfileset dir="../launcher/scripts" includes="checkindex.sh" prefix="archivesspace/scripts" filemode="755" />
<zipfileset dir="../launcher/scripts" includes="checkindex.bat" prefix="archivesspace/scripts" filemode="755" />
<zipfileset dir="../launcher/plugin_gems" includes="initialize-plugin.sh" prefix="archivesspace/scripts" filemode="755" />
<zipfileset dir="../launcher/plugin_gems" includes="initialize-plugin.bat" prefix="archivesspace/scripts" filemode="644" />
<zipfileset dir="../launcher/password_reset" includes="password-reset.sh" prefix="archivesspace/scripts" filemode="755" />
Expand Down
87 changes: 0 additions & 87 deletions build/scripts/checkindex.rb

This file was deleted.

1 change: 1 addition & 0 deletions common/config/config-aliases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@

AppConfig.add_deprecated(:bulk_import_rows)
AppConfig.add_deprecated(:bulk_import_size)
AppConfig.add_deprecated(:solr_home_directory)

# AppConfig.ensure_false(:enable_custom_reports)
13 changes: 8 additions & 5 deletions common/config/config-defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
# set it to something else below.
AppConfig[:oai_url] = "http://localhost:8082"

# The ArchivesSpace Solr index listens on port 8090 by default. You can
# set it to something else below.
# The ArchivesSpace Solr index url default. You can set it to something else below.
AppConfig[:solr_url] = "http://localhost:8983/solr/archivesspace"

# The ArchivesSpace indexer listens on port 8091 by default. You can
Expand Down Expand Up @@ -74,7 +73,9 @@
# By default, Solr backups will run at midnight. See https://crontab.guru/ for
# information about the schedule syntax.
AppConfig[:solr_backup_schedule] = "0 0 * * *"
AppConfig[:solr_backup_number_to_keep] = 1
# By default no backups. If enabling (by setting > 0) then you must also ensure
# that AppConfig[:solr_index_directory] is set to the correct path
AppConfig[:solr_backup_number_to_keep] = 0
AppConfig[:solr_backup_directory] = proc { File.join(AppConfig[:data_directory], "solr_backups") }
# add default solr params, i.e. use AND for search: AppConfig[:solr_params] = { 'mm' => '100%' }
# Another example below sets the boost query value (bq) to boost the relevancy for the query string in the title,
Expand Down Expand Up @@ -148,8 +149,10 @@
AppConfig[:data_directory] = File.join(Dir.home, "ArchivesSpace")

AppConfig[:backup_directory] = proc { File.join(AppConfig[:data_directory], "demo_db_backups") }
AppConfig[:solr_index_directory] = proc { File.join(AppConfig[:data_directory], "solr_index") }
AppConfig[:solr_home_directory] = proc { File.join(AppConfig[:data_directory], "solr_home") }
# Set the path to the solr index for the external Solr instance.
# This setting is used by the solr backups configuration but only
# applies if the solr index directory is accessible to ArchivesSpace.
AppConfig[:solr_index_directory] = File.join('', 'var', 'solr', 'data', 'archivesspace', 'data')
AppConfig[:solr_indexing_frequency_seconds] = 30
AppConfig[:solr_facet_limit] = 100

Expand Down
5 changes: 5 additions & 0 deletions common/solr_snapshotter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ def self.wait_for_snapshot_to_finish(starting_status, starting_snapshot)


def self.do_snapshot(identifier = nil)
unless File.directory?(AppConfig[:solr_index_directory])
log(:info, "Skipping Solr snapshot, not a directory: #{AppConfig[:solr_index_directory]}")
return
end

identifier ||= Time.now.to_i

target = File.join(AppConfig[:solr_backup_directory], "solr.#{identifier}")
Expand Down
14 changes: 0 additions & 14 deletions launcher/scripts/checkindex.bat

This file was deleted.

17 changes: 0 additions & 17 deletions launcher/scripts/checkindex.sh

This file was deleted.

0 comments on commit 57ae667

Please sign in to comment.