diff --git a/docker-compose.yml b/docker-compose.yml index c06f3f0..2f19cbc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -85,7 +85,7 @@ services: - node.name=opensearch-node - discovery.type=single-node - bootstrap.memory_lock=false - - "OPENSEARCH_JAVA_OPTS=-Xms256m -Xmx512m --add-opens=java.base/java.lang=ALL-UNNAMED -Dlucene.useVectorAPI=false -Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false" + - "OPENSEARCH_JAVA_OPTS=-Xms256m -Xmx512m --add-opens=java.base/java.lang=ALL-UNNAMED -Dlucene.useVectorAPI=false -Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false -verbose:class -verbose:gc" - "DISABLE_INSTALL_DEMO_CONFIG=true" - "DISABLE_SECURITY_PLUGIN=true" - "DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI=true" @@ -97,6 +97,13 @@ services: memory: 1G reservations: memory: 512M + stop_grace_period: 30s + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 120s ulimits: memlock: soft: -1 @@ -109,12 +116,6 @@ services: networks: - storycove-network restart: unless-stopped - healthcheck: - test: ["CMD-SHELL", "curl -f http://localhost:9200 || exit 1"] - interval: 30s - timeout: 10s - retries: 5 - start_period: 60s opensearch-dashboards: image: opensearchproject/opensearch-dashboards:3.2.0 diff --git a/opensearch.Dockerfile b/opensearch.Dockerfile index c62beec..5cbcc57 100644 --- a/opensearch.Dockerfile +++ b/opensearch.Dockerfile @@ -50,6 +50,10 @@ RUN mkdir -p /usr/share/opensearch/data && \ echo "-Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false" >> /usr/share/opensearch/config/jvm.options.d/synology.options && \ echo "-Djava.awt.headless=true" >> /usr/share/opensearch/config/jvm.options.d/synology.options && \ echo "-XX:+UseContainerSupport" >> /usr/share/opensearch/config/jvm.options.d/synology.options && \ + echo "-Dorg.opensearch.bootstrap.start_timeout=60s" >> /usr/share/opensearch/config/jvm.options.d/synology.options && \ + echo "-XX:+PrintGCDetails" >> /usr/share/opensearch/config/jvm.options.d/synology.options && \ + echo "-XX:+TraceClassLoading" >> /usr/share/opensearch/config/jvm.options.d/synology.options && \ + echo "-Dopensearch.logger.level=DEBUG" >> /usr/share/opensearch/config/jvm.options.d/synology.options && \ echo '#!/bin/bash' > /usr/share/opensearch/start-opensearch.sh && \ echo 'echo "Starting OpenSearch with Java 21..."' >> /usr/share/opensearch/start-opensearch.sh && \ echo 'echo "Java version:"' >> /usr/share/opensearch/start-opensearch.sh && \ @@ -64,7 +68,14 @@ RUN mkdir -p /usr/share/opensearch/data && \ echo 'echo "Using JVM options file: /usr/share/opensearch/config/jvm.options.d/synology.options"' >> /usr/share/opensearch/start-opensearch.sh && \ echo 'cat /usr/share/opensearch/config/jvm.options.d/synology.options' >> /usr/share/opensearch/start-opensearch.sh && \ echo 'echo "Environment OPENSEARCH_JAVA_OPTS: $OPENSEARCH_JAVA_OPTS"' >> /usr/share/opensearch/start-opensearch.sh && \ - echo 'exec /usr/share/opensearch/bin/opensearch' >> /usr/share/opensearch/start-opensearch.sh && \ + echo 'echo "Attempting to force disable vector operations..."' >> /usr/share/opensearch/start-opensearch.sh && \ + echo 'export OPENSEARCH_JAVA_OPTS="$OPENSEARCH_JAVA_OPTS -Dlucene.useVectorAPI=false -Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false --limit-modules=java.base,java.logging,java.xml,java.management,java.naming,java.desktop,java.security.jgss"' >> /usr/share/opensearch/start-opensearch.sh && \ + echo 'echo "Final OPENSEARCH_JAVA_OPTS: $OPENSEARCH_JAVA_OPTS"' >> /usr/share/opensearch/start-opensearch.sh && \ + echo 'echo "Starting OpenSearch binary..."' >> /usr/share/opensearch/start-opensearch.sh && \ + echo 'timeout 300s /usr/share/opensearch/bin/opensearch &' >> /usr/share/opensearch/start-opensearch.sh && \ + echo 'OPENSEARCH_PID=$!' >> /usr/share/opensearch/start-opensearch.sh && \ + echo 'echo "OpenSearch started with PID: $OPENSEARCH_PID"' >> /usr/share/opensearch/start-opensearch.sh && \ + echo 'wait $OPENSEARCH_PID' >> /usr/share/opensearch/start-opensearch.sh && \ chmod +x /usr/share/opensearch/start-opensearch.sh && \ chown -R opensearch:opensearch /usr/share/opensearch