From 8c980ff5c6069e8e46b3e48d5719817b77ebf132 Mon Sep 17 00:00:00 2001 From: Yevhen Podlyzhnyi Date: Tue, 20 Aug 2024 11:50:33 +0300 Subject: [PATCH] health check workaround --- .env | 2 ++ docker-compose.opensearch.yaml | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.env b/.env index 642ae0ea..ef5ccc16 100644 --- a/.env +++ b/.env @@ -46,3 +46,5 @@ RESOURCE_AUTHORIZATIONS_ENABLED=false # ZEEBE_AUTHENTICATION_MODE=identity # MULTI_TENANCY_ENABLED=false + +OPENSEARCH_INITIAL_ADMIN_PASSWORD=OpenSearch_Admin1234! diff --git a/docker-compose.opensearch.yaml b/docker-compose.opensearch.yaml index 99373b1b..d3c95cdd 100644 --- a/docker-compose.opensearch.yaml +++ b/docker-compose.opensearch.yaml @@ -336,8 +336,8 @@ services: opensearch: image: opensearchproject/opensearch:${OPENSEARCH_VERSION} container_name: opensearch - # depends_on: - # - opensearch-init + depends_on: + - opensearch-init environment: - cluster.name=opensearch-cluster - node.name=opensearch @@ -347,7 +347,7 @@ services: - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping - path.repo=/usr/local/os-snapshots - "OPENSEARCH_JAVA_OPTS=-Xms1G -Xmx1G" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM - - OPENSEARCH_INITIAL_ADMIN_PASSWORD=OpenSearch_Admin1234! + - OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD} ulimits: memlock: soft: -1 @@ -360,10 +360,11 @@ services: - "9601:9600" restart: always healthcheck: - test: [ "CMD-SHELL", "curl -f http://localhost:9200/_cat/health | grep -q green" ] - interval: 30s - timeout: 240s - retries: 3 + # test: [ "CMD-SHELL", "curl -f http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s | grep -q green" ] + test: [ "CMD-SHELL", "curl -f http://localhost:9200/_cluster/health?wait_for_status=yellow | grep -q -E 'yellow|green'" ] + interval: 60s + timeout: 30s + retries: 5 volumes: # - opensearch-data:/usr/share/opensearch/data - ./os-snapshots:/usr/local/os-snapshots