Hide Forgot
Description of problem: Not able to set extra java options in JBoss EAP and EWS cartridges, such as extra tuning and garbage collection parameters. It would be great if we could have something like : "rhc env set JAVA_OPTS_EXT" which is present in latest OpenShift online version. Version-Release number of selected component (if applicable): OSE 1.2 How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
https://github.com/openshift/enterprise-server/pull/140
Verify this bug on puddle: http://buildvm-devops.usersys.redhat.com/puddle/build/OpenShiftEnterprise/1.2/2013-09-27.1/ 1. Create jbossews 2.0 app #rhc app create $appname jbossews-2.0 2. Add an user env_vars to the app with name JAVA_OPTS_EXT [root@node ~]#oo-env-var-add --with-app-uuid 5247c97f5946d3132c00007b --with-container-uuid 5247c97f5946d3132c00007b --with-key JAVA_OPTS_EXT --with-value "-XX:+PrintGCDetails -Xloggc:gc.log" 3. Restart the app or cartridge to restart the java process 4. Find the gc.log under gear home dir /var/lib/openshift/5247c97f5946d3132c00007b/jbossews/gc.log
Currently OSE does not support "rhc env set JAVA_OPTS_EXT", so QE only add user env var using oo-env-var-add on node to verify this bug just like comment 4.
The jbosseap-6.0 app's situation is the same as comment 4.
Nan and Johnny, The user can still add the variable using a pre_start hook, we should probably test for that situation for OSE 1.2
Can the customer get the patch for testing in their env as a part of the QA process prior to the 1.2.4 release? Any idea when 1.2.4 is going to release ?
Created attachment 808969 [details] patch for suporting JAVA_OPTS_EXT If you look inside the patch you will see standalone.sh is updated for the EAP cartridge and bin/tomcat for EWS. The files can be found at: /var/lib/openshift/.cartridge_repository/redhat-jbosseap/0.0.1/versions/6.0/bin/standalone.sh /var/lib/openshift/.cartridge_repository/redhat-jbossews/0.0.1/bin/tomcat
(In reply to Jason DeTiberus from comment #7) > Nan and Johnny, > > The user can still add the variable using a pre_start hook, we should > probably test for that situation for OSE 1.2 I tried to add the variable using a pre_start hook, here I am not sure what means "add", export is ok?? I did the following operation: $ cat .openshift/action_hooks/pre_start #!/bin/sh echo "############" export JAVA_OPTS_EXT="-XX:+PrintGCDetails -Xloggc:gc.log" echo $JAVA_OPTS_EXT echo "############" $ git push <--snip--> remote: Deploying JBoss remote: ############ remote: -XX:+PrintGCDetails -Xloggc:gc.log remote: ############ remote: Starting jbosseap cart remote: Found 127.7.204.129:8080 listening port <--snip--> Then ssh into gear to check java process, I did not find "JAVA_OPTS_EXT" parameters for java process. That means pre_start could not add the variable for java process. Could you help have a double confirm?
And one more issue is looks like this does not support scalable app. When I use oo-env-var-add command to add JAVA_OPTS_EXT var to primary gear, then scale-up, the new gear does not enable JAVA_OPTS_EXT var. Is it expected?
The pre_start hook needs to have the cartridge name included, so pre_start_jbosseap for EAP and pre_start_jbossews for EWS. .openshift/action_hooks/pre_start_jbosseap: #!/bin/bash export JAVA_OPTS_EXT="-XX:+UseG1GC" echo "JAVA_OPTS_EXT: ${JAVA_OPTS_EXT}" Output from push: ... remote: Deploying JBoss remote: JAVA_OPTS_EXT: -XX:+UseG1GC remote: Starting jbosseap cart remote: Found 127.1.244.1:8080 listening port To ssh://52540a46c1a36e45d3000006.com/~/git/eap.git/ b12189b..481e5f0 master -> master VM Arguments before: 09:36:23,980 DEBUG [org.jboss.as.config] VM Arguments: -D[Standalone] -XX:+UseCompressedOops -XX:+TieredCompilation -Xmx256m -XX:MaxPermSize=102m -XX:+AggressiveOpts -Dorg.apache.tomcat.util.LOW_MEMORY=true -DOPENSHIFT_APP_UUID=52540a46c1a36e45d3000006 -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djboss.node.name=eap-test.example.com -Djgroups.bind_addr=127.1.244.1 -Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on -Dorg.jboss.boot.log.file=/var/lib/openshift/52540a46c1a36e45d3000006/jbosseap/standalone/log/boot.log -Dlogging.configuration=file:/var/lib/openshift/52540a46c1a36e45d3000006/jbosseap/standalone/configuration/logging.properties VM Arguments after: [eap-test.example.com logs]\> ps -ef | grep java 1000 21916 21739 4 09:42 ? 00:00:15 /etc/alternatives/java_sdk_1.7.0/bin/java -D[Standalone] -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xmx256m -XX:MaxPermSize=102m -XX:+AggressiveOpts -Dorg.apache.tomcat.util.LOW_MEMORY=true -DOPENSHIFT_APP_UUID=52540a46c1a36e45d3000006 -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djboss.node.name=eap-test.example.com -Djgroups.bind_addr=127.1.244.1 -Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on -XX:+UseG1GC -Dorg.jboss.boot.log.file=/var/lib/openshift/52540a46c1a36e45d3000006/jbosseap/standalone/log/boot.log -Dlogging.configuration=file:/var/lib/openshift/52540a46c1a36e45d3000006/jbosseap/standalone/configuration/logging.properties -jar /var/lib/openshift/52540a46c1a36e45d3000006/jbosseap/jboss-modules.jar -mp /var/lib/openshift/52540a46c1a36e45d3000006/app-root/runtime/repo//.openshift/config/modules:/var/lib/openshift/52540a46c1a36e45d3000006/jbosseap/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=/var/lib/openshift/52540a46c1a36e45d3000006/jbosseap
Verify this bug with openshift-origin-cartridge-jbosseap-2.3.11.3-1.git.0.4d0ae9b.el6op.noarch, and PASS. Create pre_start_jbosseap for EAP and pre_start_jbossews for EWS. $ cat .openshift/action_hooks/pre_start_jbossews #!/bin/sh echo "####bbb########" export JAVA_OPTS_EXT="-XX:+PrintGCDetails -Xloggc:gc.log" echo $JAVA_OPTS_EXT touch "bbb" echo "############" " Output from push: ... remote: ####bbb######## remote: -XX:+PrintGCDetails -Xloggc:gc.log remote: ############ remote: Found 127.1.245.1:8080 listening port ... ssh into gear, check java process, and found "-XX:+PrintGCDetails -Xloggc:gc.log" is added to the process. Test jbosseap and jbossews app including scalable type, both of them are working fine. [scajbosseapapp-jialiu.ose124-1008.com.cn 525515fb636d0c1004000100]\> ps -ef|grep GC 1004 17482 17256 24 02:36 ? 00:00:23 /etc/alternatives/java_sdk_1.7.0/bin/java -D[Standalone] -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xmx256m -XX:MaxPermSize=102m -XX:+AggressiveOpts -Dorg.apache.tomcat.util.LOW_MEMORY=true -DOPENSHIFT_APP_UUID=525515fb636d0c1004000100 -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djboss.node.name=scajbosseapapp-jialiu.ose124-1008.com.cn -Djgroups.bind_addr=127.1.246.1 -Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION=on -XX:+PrintGCDetails -Xloggc:gc.log -Dorg.jboss.boot.log.file=/var/lib/openshift/525515fb636d0c1004000100/jbosseap/standalone/log/boot.log -Dlogging.configuration=file:/var/lib/openshift/525515fb636d0c1004000100/jbosseap/standalone/configuration/logging.properties -jar /var/lib/openshift/525515fb636d0c1004000100/jbosseap/jboss-modules.jar -mp /var/lib/openshift/525515fb636d0c1004000100/app-root/runtime/repo//.openshift/config/modules:/var/lib/openshift/525515fb636d0c1004000100/jbosseap/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -Djboss.home.dir=/var/lib/openshift/525515fb636d0c1004000100/jbosseap
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-1435.html