Java_opts Environment Variable



Java

Add the desired Java options to the file, as if you were setting the options via the export command for creating the JAVAOPTS environment variable. For example, a project may need to adjust the Xms and Xmx settings to build correctly. We set these values in the java.config file as we would have by export JAVAOPTS.Xms256m -Xmx512m.

JAVAOPTSis not used by the JDK, but by a bunch of other apps (see this post). JAVATOOLOPTIONSand JAVAOPTIONSare ways to specify JVM arguments as an environment variable instead of command line parameters. The are picked up. The Environment Variables for Tomcat within IDEA, has a READ-ONLY JAVAOPTS field that is used to setup the debug options.

I am using StreamSets Data Collector and am trying to configure TLS. I am following this guide:https://streamsets.com/documentation/...

In Step 3, it says to configure a few sdc.properties via environment variables and some Java properties in the same way. The SDC properties are being set properly. However, the Java properties are never being set. I am putting them into an environment variable 'SDC_JAVA_OPTS'. The env var is populated but the values are never set in the Java properties file '$JAVA_HOME/jre/lib/management/management.properties'. This is causing Streamsets to crash with this error from Java:'java.lang.RuntimeException: java.io.IOException: Keystore was tampered with, or password was incorrect, calling stopTask() and going into ERROR'

Environment

Note: I am running SDC 3.8.0 in Docker container inside Kubernetes deploying with Helm.

Update 5/1: I was able to turn on verbose mode and it appears sdc-env.sh is being run and any values I set to SDC_JAVA_OPTS are getting into the env at startup. The problem still remains that my values are not being set in the java management.properties file. You can see below a part of the verbose output showing the JAVA OPTS at startup. I have added -Djavax.net.ssl.trustStore and -Djavax.net.ssl.trustStorePassword via K8S environment variable.Verbose output:'JAVA OPTS : -Djava.security.manager -Djava.security.policy=file:///etc/sdc/sdc-security.policy -Xmx1024m -Xms1024m -server -XX:-OmitStackTraceInFastThrow -Djavax.net.ssl.trustStore=/data/security/sdc-company.truststore.jks -Djavax.net.ssl.trustStorePassword=** -Dsdc.di......'

Update 5/2: It appears that my keystore/truststore files and passwords are input correctly (no errors). Unfortunately once I set the HTTPS port it brakes my UI. I think it's just a port issue with my k8s service. I think this can be closed now, thank you for your help.

Any help would be appreciated.

Variable

Thank you.

editretagflag offensiveclosemergedelete

Comments

What type of SDC installation do you have? Are you sure you set the SDC_JAVA_OPTS in the correct place, for your installation type?

See: https://streamsets.com/documentation/datacollector/latest/help/datacollector/UserGuide/Configuration/DCEnvironmentConfig.html#concept_zhl_rb3_qcb

DefinitionEnvironment

Java_opts Environment Variable Example

I am deploying the SDC 3.8.0 container with Helm to a K8S cluster. I am setting things like SDC_CONF_HTTPS_KEYSTORE_PATH and SDC_JAVA_OPTS in my Helm chart.

I also noticed in this file: $SDC_DIST/libexec/sdc-env.sh that it is doing an export on SDC_JAVA_OPTS `export SDC_JAVA_OPTS='-Xmx1024m -Xms102'. However, unless I set SDC_JAVA_OPTS. This var is empty/not set. It’s almost like sdc-env.sh is not being run on sdc start up.

Java Home Environment Variables

From your link above: 'Data Collector loads the value of the version-specific environment variable and adds it to the SDC_JAVA_OPTS environment variable'. This is not being set by default. This is what I was referring to in my last comment. ^