Skip to content

Commit

Permalink
Merge pull request #38 from mlibrary/asc-48-disable-solr-index-lock
Browse files Browse the repository at this point in the history
Change Solr `indexConfig` `lockType` to `single` (ASC-48)
  • Loading branch information
gkostin1966 authored Dec 15, 2023
2 parents f57177f + 5f72bc6 commit 9f3cfa0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
14 changes: 13 additions & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ RUN apt-get update && \
git \
wget \
unzip \
default-jdk && \
default-jdk \
xmlstarlet && \
rm -rf /var/lib/apt/lists/*

# Install Archives Space
Expand All @@ -26,6 +27,17 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \
unzip -q /archivesspace-$ARCHIVESSPACE_VERSION.zip -d / && \
mv /archivesspace/config/config.rb /archivesspace/config/config-$ARCHIVESSPACE_VERSION.rb

# indexConfig/lockType is set to single in solrconfig.xml to prevent issues that occur with
# file-based locks when Solr exits improperly.
# lockType cannot be set via SOLR_OPTS because an indexConfig variable is not provided in
# the ArchivesSpace release's configuration.
# This change also needs to be made in the app image because the application compares
# the checksums of its and Solr's configuration files.
RUN xmlstarlet edit --inplace \
--subnode "/config" --type elem -n indexConfig \
--subnode "/config/indexConfig" --type elem -n lockType --value "\${solr.lock.type:single}" \
/archivesspace/solr/solrconfig.xml

# Install Java MySQL Connector
RUN wget -q https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.30/mysql-connector-java-8.0.30.jar && \
cp /mysql-connector-java-8.0.30.jar /archivesspace/lib/
Expand Down
12 changes: 11 additions & 1 deletion solr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ RUN apt-get update && \
ca-certificates \
git \
wget \
unzip
unzip \
xmlstarlet

# Install Archives Space
RUN if [ "$ASPACE_VERSION" = "latest" ]; then \
Expand All @@ -23,6 +24,15 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \
wget -q https://github.com/archivesspace/archivesspace/releases/download/$ARCHIVESSPACE_VERSION/archivesspace-$ARCHIVESSPACE_VERSION.zip && \
unzip -q /archivesspace-$ARCHIVESSPACE_VERSION.zip -d /

# indexConfig/lockType is set to single in solrconfig.xml to prevent issues that occur with
# file-based locks when Solr exits improperly.
# lockType cannot be set via SOLR_OPTS because an indexConfig variable is not provided in
# the ArchivesSpace release's configuration.
RUN xmlstarlet edit --inplace \
--subnode "/config" --type elem -n indexConfig \
--subnode "/config/indexConfig" --type elem -n lockType --value "\${solr.lock.type:single}" \
/archivesspace/solr/solrconfig.xml

# List Archives Space Solr Conf Files
RUN ls -l /archivesspace/solr

Expand Down

0 comments on commit 9f3cfa0

Please sign in to comment.