-
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Introduce TYPO3_SOLR_ENABLED_CORES docker env variable
This adds a startup script which disables all unneeded cores. Usage: `docker run -e 'TYPO3_SOLR_ENABLED_CORES=english german' -it typo3solr/ext-solr` This enables only the english and german core (core_en, core_de) during startup. If the env variable is not set, then all cores are enabled (= default behaviour). The additional cores can be enabled afterwards by adding them to the TYPO3_SOLR_ENABLED_CORES env. variable. Fixes: #3502
- Loading branch information
Showing
5 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Docker/SolrServer/docker-entrypoint-initdb.d/disable-cores.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
shopt -s extglob | ||
|
||
if [ -n "${TYPO3_SOLR_ENABLED_CORES}" ] | ||
then | ||
for CORE_TO_DISABLE in /var/solr/data/cores/*/core.properties | ||
do | ||
mv "${CORE_TO_DISABLE}" "${CORE_TO_DISABLE}_disabled"; | ||
done | ||
|
||
for CORE_to_ENABLE in ${TYPO3_SOLR_ENABLED_CORES} | ||
do | ||
echo "Enable core ${CORE_to_ENABLE}" | ||
mv "/var/solr/data/cores/${CORE_to_ENABLE}/core.properties_disabled" "/var/solr/data/cores/${CORE_to_ENABLE}/core.properties" | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.. include:: /Includes.rst.txt | ||
|
||
|
||
.. _appendix-docker-tweaks: | ||
|
||
Appendix - Docker Tweaks | ||
======================== | ||
|
||
Beside of original Apache Solr Docker image, on which is our image based on we provide some tweaks to make our and your work simpler. | ||
|
||
Disable unnecessary cores on container start | ||
-------------------------------------------- | ||
|
||
By defining env ``TYPO3_SOLR_ENABLED_CORES`` with a space separated list of languages/cores to enable, only those cores will be initialized on start-up. | ||
This allows to save memory usage of Apache Solr server instance. | ||
|
||
Usage: | ||
|
||
.. code-block:: bash | ||
docker run -e 'TYPO3_SOLR_ENABLED_CORES=english german' -it typo3solr/ext-solr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters