7.14. fabric:container-edit-jvm-options
Abstract
Replace the JVM options used to launch a container
Synopsis
fabric:container-edit-jvm-options
[
--help
] [
-u, --username user
] [
-p, --password password
] {
Container
} [
JVMOptions
]
Description
Enables you to set the Java Virtual Machine (JVM) options that are passed to the Java runtime when launching the container. Note that this command replaces all of the existing JVM options for the container. Hence, when you invoke this command, you must specify all of the container's JVM options, not just the ones you want to add.
For example, suppose you have a container named
ssh2
and you want to add the following JVM options: -Xms2048M
-Xmx8192M
. Proceed as follows:
- Invoke the
container-edit-jvm-options
command to discover the current JVM options used by thessh2
container, as follows:JBossFuse:karaf@root> container-edit-jvm-options ssh2 -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Djava.endorsed.dirs=/usr/lib/jvm/jre/jre/lib/endorsed:/usr/lib/jvm/jre/lib/endorsed:/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/jre/jre/lib/ext:/usr/lib/jvm/jre/lib/ext:/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/lib/ext -Dkaraf.instances=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/instances -Dkaraf.home=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133 -Dkaraf.base=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133 -Dkaraf.data=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/data -Dkaraf.etc=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/etc -Djava.io.tmpdir=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/data/tmp -Djava.util.logging.config.file=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/etc/java.util.logging.properties -Djavax.management.builder.initial=org.apache.karaf.management.boot.KarafMBeanServerBuilder -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true
- Invoke the
container-edit-jvm-options
command, passing all of new JVM options as the second argument to the command (enclosed in single or double quotes). That is, to construct the second argument, copy the JVM options output from the previous step, append your additional JVM arguments, and enclose all of these JVM options in quotes. For example:JBossFuse:karaf@root> container-edit-jvm-options ssh2 '-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Djava.endorsed.dirs=/usr/lib/jvm/jre/jre/lib/endorsed:/usr/lib/jvm/jre/lib/endorsed:/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/jre/jre/lib/ext:/usr/lib/jvm/jre/lib/ext:/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/lib/ext -Dkaraf.instances=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/instances -Dkaraf.home=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133 -Dkaraf.base=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133 -Dkaraf.data=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/data -Dkaraf.etc=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/etc -Djava.io.tmpdir=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/data/tmp -Djava.util.logging.config.file=/home/fuse/containers/ssh2/fabric8-karaf-1.2.0.redhat-133/etc/java.util.logging.properties -Djavax.management.builder.initial=org.apache.karaf.management.boot.KarafMBeanServerBuilder -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -Xms2048M -Xmx8192M'
- In order for these new JVM options to take effect, you need to restart the
ssh2
container, as follows:JBossFuse:karaf@root> container-stop ssh2 JBossFuse:karaf@root> container-start ssh2
- Verify that the current JVM settings have the new values, as follows:
JBossFuse:karaf@root> container-edit-jvm-options ssh2 ...
Arguments
Table 7.14, “fabric:container-edit-jvm-options Arguments” describes the command's arguments.
Argument | Interpretation |
---|---|
--help | Displays the online help for this command. |
-u, --username | Specifies the username to log on to a remote container. |
-p, --password | Specifies the password to log on to a remote container. |
Container | The name of the container. |
JVMOptions | Specifies the container's new JVM options, which completely replace the old JVM options. If this argument is omitted, the command shows the existing JVM options for the specified container. |