Solr local: same layout as prod (configsets from solr_cores), service solr-new renamed solr
- image pinned to solr:8.10.1, SOLR_HOME=/var/solr/data, solr_cores mounted ro on /opt/configsets - update_solr_config.sh writes into a solr_cores tree and RELOADs cores - solr_cores bumped to configset restructure, solr_cores_stage worktree ignored Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -9,4 +9,5 @@ solr_data/*
|
||||
var_solr/*
|
||||
ressources/xdebug.ini
|
||||
ressources/*.sql.gz
|
||||
ai-docs/
|
||||
ai-docs/
|
||||
solr_cores_stage/
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM solr:8.10
|
||||
FROM solr:8.10.1
|
||||
|
||||
# COPY --chown=solr:solr ./server /opt/solr/server/solr/
|
||||
|
||||
@@ -21,7 +21,7 @@ buildnc:
|
||||
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME)
|
||||
|
||||
buildsolrnc:
|
||||
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) solr-new
|
||||
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) solr
|
||||
|
||||
buildphp:
|
||||
docker-compose build --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) php
|
||||
@@ -67,7 +67,7 @@ down:
|
||||
docker-compose down
|
||||
|
||||
restart_solr:
|
||||
docker-compose restart solr-new
|
||||
docker-compose restart solr
|
||||
|
||||
restart_redis:
|
||||
docker-compose restart redis
|
||||
@@ -94,7 +94,7 @@ exec_mysql:
|
||||
docker exec -it materiod8-mysql-1 bash
|
||||
|
||||
exec_solr:
|
||||
docker exec -it materiod8-solr-new-1 bash
|
||||
docker exec -it materiod8-solr-1 bash
|
||||
|
||||
exec_solrlegacy:
|
||||
docker exec -it materiod8-solr-legacy-1 bash
|
||||
|
||||
@@ -1,11 +1,34 @@
|
||||
#! /bin/bash
|
||||
# Régénère la config Solr depuis Drupal (search_api_solr) et l'écrit dans un arbre du dépôt solr_cores,
|
||||
# puis recharge les cores (RELOAD, sans restart).
|
||||
#
|
||||
# bin/update_solr_config.sh -> solr_cores (branche prod, Solr 8, :8985)
|
||||
# bin/update_solr_config.sh solr_cores_stage URL -> worktree stage (Solr 9, phase 2)
|
||||
#
|
||||
# Les modifications restent à relire / committer dans l'arbre visé (git diff).
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit 1
|
||||
|
||||
TREE=${1:-solr_cores}
|
||||
SOLR=${2:-http://localhost:8985/solr}
|
||||
CORES="materio_base materio_autocomplete"
|
||||
|
||||
[ -d "$TREE/materio_base/conf" ] || { echo "arbre $TREE invalide" >&2; exit 1; }
|
||||
|
||||
docker exec -i materiod8-php-1 drush cdel search_api_solr.solr_field_type.text_edgestring_ascii_und_6_0_0
|
||||
docker exec -i materiod8-php-1 drush cdel search_api_solr.solr_field_type.text_string_ascii_und_6_0_0
|
||||
docker exec -i materiod8-php-1 drush dre materio_sapi
|
||||
docker exec -i materiod8-php-1 drush solr-gsc database_search_autocomplete config.zip
|
||||
mkdir ressources/solr/
|
||||
mv public_html/web/config.zip ressources/solr/
|
||||
unzip -o ressources/solr/config.zip -d var_solr/data/materio/conf
|
||||
unzip -o ressources/solr/config.zip -d var_solr/data/materio_autocomplete/conf
|
||||
docker-compose restart solr-new
|
||||
docker exec -i materiod8-php-1 drush solr-gsc database_search_autocomplete config.zip || exit 1
|
||||
mkdir -p ressources/solr/
|
||||
mv public_html/web/config.zip ressources/solr/ || exit 1
|
||||
|
||||
for core in $CORES; do
|
||||
unzip -o ressources/solr/config.zip -d "$TREE/$core/conf"
|
||||
done
|
||||
|
||||
for core in $CORES; do
|
||||
out=$(curl -s "$SOLR/admin/cores?action=RELOAD&core=$core&wt=json")
|
||||
if echo "$out" | grep -q '"status":0'; then echo "RELOAD $core OK"; else echo "RELOAD $core ÉCHEC : $out" >&2; fi
|
||||
done
|
||||
|
||||
git -C "$TREE" status --short
|
||||
|
||||
+7
-6
@@ -55,19 +55,20 @@ services:
|
||||
# ports:
|
||||
# - "6388"
|
||||
|
||||
solr-new:
|
||||
solr:
|
||||
build: ./Docker/solr/
|
||||
# user: ${USER_UID}:${USER_GID}
|
||||
# même structure que CT-materio (prod) : SOLR_HOME = /var/solr/data (solr.xml + core.properties + index),
|
||||
# configsets = dépôt solr_cores (branche prod), monté en lecture seule (configSetBaseDir dans solr.xml)
|
||||
environment:
|
||||
- SOLR_HOME=/var/solr
|
||||
- SOLR_HOME=/var/solr/data
|
||||
volumes:
|
||||
- ./var_solr:/var/solr
|
||||
- ./var_solr:/var/solr
|
||||
- ./solr_cores:/opt/configsets:ro
|
||||
# - solr-data: /var/solr
|
||||
# - "${SOLR_CORES}:/var/solr/data"
|
||||
# - "${SOLR_DATA}:/var/solr"
|
||||
# - "${SOLR_CORES}:/opt/solr/server/solr"
|
||||
command:
|
||||
- solr-precreate
|
||||
networks:
|
||||
- solr
|
||||
ports:
|
||||
@@ -111,7 +112,7 @@ services:
|
||||
- mysql
|
||||
# - mysql-legacy
|
||||
- redis
|
||||
- solr-new
|
||||
- solr
|
||||
|
||||
# php-legacy:
|
||||
# build: ./Docker/php-legacy/
|
||||
|
||||
+1
-1
Submodule solr_cores updated: 3665537182...6ecfbdd621
Reference in New Issue
Block a user