此内容没有您所选择的语言版本。

9.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:
  1. Invoke the container-edit-jvm-options command to discover the current JVM options used by the ssh2 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
  2. 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'
  3. 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
  4. Verify that the current JVM settings have the new values, as follows:
    JBossFuse:karaf@root> container-edit-jvm-options ssh2
    ...

Arguments

Table 9.14. fabric:container-edit-jvm-options Arguments
ArgumentInterpretation
--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.
ContainerThe name of the container.
JVMOptionsSpecifies 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.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.