This commit is contained in:
Stefan Hardegger
2025-09-21 17:47:03 +02:00
parent 042f80dd2a
commit 6c02b8831f
2 changed files with 9 additions and 4 deletions

View File

@@ -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 -XX:-UseLoopPredicate -Dlucene.useVectorAPI=false -XX:+UseG1GC -XX:G1HeapRegionSize=4m"
- "OPENSEARCH_JAVA_OPTS=-Xms256m -Xmx512m --add-opens=java.base/java.lang=ALL-UNNAMED -Dlucene.useVectorAPI=false -Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false"
- "DISABLE_INSTALL_DEMO_CONFIG=true"
- "DISABLE_SECURITY_PLUGIN=true"
- "DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI=true"

View File

@@ -45,6 +45,11 @@ RUN mkdir -p /usr/share/opensearch/data && \
echo "logger.level: DEBUG" >> /usr/share/opensearch/config/opensearch.yml && \
echo "node.processors: 1" >> /usr/share/opensearch/config/opensearch.yml && \
rm -rf /usr/share/opensearch/plugins/opensearch-performance-analyzer && \
echo "# Custom JVM options for Synology NAS compatibility" > /usr/share/opensearch/config/jvm.options.d/synology.options && \
echo "-Dlucene.useVectorAPI=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 "-XX:+UseContainerSupport" >> /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 && \
@@ -56,9 +61,9 @@ RUN mkdir -p /usr/share/opensearch/data && \
echo 'uname -a' >> /usr/share/opensearch/start-opensearch.sh && \
echo 'echo "CPU info:"' >> /usr/share/opensearch/start-opensearch.sh && \
echo 'grep -E "^(processor|model name|flags)" /proc/cpuinfo | head -10 || echo "CPU info not available"' >> /usr/share/opensearch/start-opensearch.sh && \
echo 'echo "Setting JVM options for compatibility..."' >> /usr/share/opensearch/start-opensearch.sh && \
echo 'export OPENSEARCH_JAVA_OPTS="$OPENSEARCH_JAVA_OPTS -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0 -Djava.awt.headless=true"' >> /usr/share/opensearch/start-opensearch.sh && \
echo 'echo "Starting with JVM options: $OPENSEARCH_JAVA_OPTS"' >> /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 '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 && \
chmod +x /usr/share/opensearch/start-opensearch.sh && \
chown -R opensearch:opensearch /usr/share/opensearch