From f560de4a2047bf97f15f03865cd5128bab71d87f Mon Sep 17 00:00:00 2001 From: Carlo Minotti <50220438+minottic@users.noreply.github.com> Date: Fri, 15 Nov 2024 11:13:33 +0100 Subject: [PATCH] Review v4 elastic setting to wait for index updated (#366) * Tweak elastic config to avoid 137 * Set v4 elastic setting to wait for index upated This is required especially for test:api:mocha to pass when elastic is enabled --- services/backend/services/v4/config/.elastic.env | 10 +++++----- .../backend/services/v4/services/elastic/compose.yaml | 2 +- .../backend/services/v4/services/elastic/config/.env | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/services/backend/services/v4/config/.elastic.env b/services/backend/services/v4/config/.elastic.env index 2f821f33..328d63e8 100644 --- a/services/backend/services/v4/config/.elastic.env +++ b/services/backend/services/v4/config/.elastic.env @@ -1,9 +1,9 @@ ELASTICSEARCH_ENABLED=yes ES_HOST="http://elastic:9200" -ES_USERNAME="elastic" -ES_PASSWORD="password" -MONGODB_COLLECTION="elastic" +ES_USERNAME=elastic +ES_PASSWORD=password +MONGODB_COLLECTION=elastic ES_MAX_RESULT=10000 ES_FIELDS_LIMIT=1000 -ES_INDEX="dataset" -ES_REFRESH="false" +ES_INDEX=dataset +ES_REFRESH=wait_for diff --git a/services/backend/services/v4/services/elastic/compose.yaml b/services/backend/services/v4/services/elastic/compose.yaml index 2dd4276a..17a3011e 100644 --- a/services/backend/services/v4/services/elastic/compose.yaml +++ b/services/backend/services/v4/services/elastic/compose.yaml @@ -3,7 +3,7 @@ services: image: docker.elastic.co/elasticsearch/elasticsearch:8.16.0 volumes: - esdata:/usr/share/elasticsearch/data - mem_limit: 1073741824 + mem_limit: 1.5g ulimits: memlock: soft: -1 diff --git a/services/backend/services/v4/services/elastic/config/.env b/services/backend/services/v4/services/elastic/config/.env index ffe7642d..60919b71 100644 --- a/services/backend/services/v4/services/elastic/config/.env +++ b/services/backend/services/v4/services/elastic/config/.env @@ -1,6 +1,5 @@ node.name=es01 cluster.name=docker-cluster -cluster.initial_master_nodes=es01 ELASTIC_PASSWORD="password" bootstrap.memory_lock=true xpack.security.enabled=false @@ -8,3 +7,5 @@ xpack.security.http.ssl.enabled=false xpack.security.transport.ssl.enabled=false xpack.license.self_generated.type=basic ES_JAVA_OPTS="-Xms512m -Xmx512m" +discovery.type=single-node +xpack.ml.enabled=false