Ce contenu n'est pas disponible dans la langue sélectionnée.

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

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.