another try

This commit is contained in:
Stefan Hardegger
2025-09-21 17:53:52 +02:00
parent 6c02b8831f
commit 7daed22d2d
2 changed files with 20 additions and 8 deletions

View File

@@ -85,7 +85,7 @@ services:
- node.name=opensearch-node - node.name=opensearch-node
- discovery.type=single-node - discovery.type=single-node
- bootstrap.memory_lock=false - 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_INSTALL_DEMO_CONFIG=true"
- "DISABLE_SECURITY_PLUGIN=true" - "DISABLE_SECURITY_PLUGIN=true"
- "DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI=true" - "DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI=true"
@@ -97,6 +97,13 @@ services:
memory: 1G memory: 1G
reservations: reservations:
memory: 512M 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: ulimits:
memlock: memlock:
soft: -1 soft: -1
@@ -109,12 +116,6 @@ services:
networks: networks:
- storycove-network - storycove-network
restart: unless-stopped 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: opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:3.2.0 image: opensearchproject/opensearch-dashboards:3.2.0

View File

@@ -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 "-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 "-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 "-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 '#!/bin/bash' > /usr/share/opensearch/start-opensearch.sh && \
echo 'echo "Starting OpenSearch with Java 21..."' >> /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 && \ 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 '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 '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 '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 && \ chmod +x /usr/share/opensearch/start-opensearch.sh && \
chown -R opensearch:opensearch /usr/share/opensearch chown -R opensearch:opensearch /usr/share/opensearch