telekom-mms / cmcc-operator

Kubernetes Operator to bring up a CoreMedia Content Cloud installation
Apache License 2.0
9 stars 3 forks source link

Unable to properly configure Solr #52

Closed stefanbethke closed 2 years ago

stefanbethke commented 2 years ago

Describe the bug Solr needs to be configured correctly to operate in a Kubernetes environment. The operator sets environment variables, but these are ignored by the entrypoint script.

To Reproduce Use the operator to bring up a CMCC workload including Solr, then observe the variables set on the STS and compare to the system properties set on the actual Solr Java process:

Environment variables set by the operator:

GC_TUNE:                   -XX:+UseG1GC -XX:+PerfDisableSharedMem -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=250 -XX:+AlwaysPreTouch
JAVA_HEAP:
JAVA_TOOL_OPTIONS:         -Dsolr.disable.shardsWhitelist=true
SOLR_JAVA_MEM:             -XX:MinRAMPercentage=80 -XX:MaxRAMPercentage=95

Actual system properties on the Java process:

/usr/local/openjdk-11/bin/java -server -Xms512m -Xmx512m -XX:+UseG1GC -XX:+PerfDisableSharedMem -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=250 -XX:+AlwaysPreTouch -Xlog:gc*:file=/var/solr/logs/solr_gc.log:time,uptime:filecount=9,filesize=20M -Dsolr.jetty.inetaccess.includes= -Dsolr.jetty.inetaccess.excludes= -Dsolr.log.dir=/var/solr/logs -Djetty.port=8983 -DSTOP.PORT=7983 -DSTOP.KEY=solrrocks -Duser.timezone=UTC -XX:-OmitStackTraceInFastThrow -XX:OnOutOfMemoryError=/opt/solr/bin/oom_solr.sh 8983 /var/solr/logs -Djetty.home=/opt/solr/server -Dsolr.solr.home=/opt/solr-8.11.2/server/solr -Dsolr.data.home= -Dsolr.install.dir=/opt/solr -Dsolr.default.confdir=/opt/solr/server/solr/configsets/_default/conf -Dlog4j.configurationFile=/var/solr/log4j2.xml -XX:-UseLargePages -DcoreRootDirectory=/var/solr/data -XX:+ExitOnOutOfMemoryError -Dsolr.leader=true -Dsolr.master=true -Dlog4j2.formatMsgNoLookups=true -Xss256k -jar start.jar --module=http --module=gzip

Note in particular the incorrect specification of -Xss, -Xms, and -Xmx instead of -XX:*RAMPercentage.

Expected behavior The desired heap configuration is applied to the Solr process.