Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wildfly 9 - How do I add jvm arguments to individual servers

I'm in the process of configuring a HA Wildfly cluster for session replication and I'm having trouble figuring out how to add JVM arguments to the individual servers in the domain. The arguments I add in domain.conf are applied to the process controller but not the individual servers. I can change the heap size for the server groups in domain.xml:

enter image description here

but I'm having trouble adding other arguments. Can I use this jvm section to add any argument? Is there another way to add arguments to server groups? Thanks.

like image 650
user3029642 Avatar asked Sep 17 '25 21:09

user3029642


1 Answers

You can use the jvm-options attribute on in CLI or you really want to edit the XML you can use <jvm-options/>.

CLI Example:

/server-group=main-server-group/jvm=default:write-attribute(name=jvm-options, value=["-XX:-HeapDumpOnOutOfMemoryError", "-XX:+UseCompressedOops"])

XML Example:

<server-group name="main-server-group" profile="full">
    <jvm name="default">
        <heap size="64m" max-size="512m"/>
        <jvm-options>
            <option value="-XX:-HeapDumpOnOutOfMemoryError"/>
            <option value="-XX:+UseCompressedOops"/>
        </jvm-options>
    </jvm>
    <socket-binding-group ref="full-sockets"/>
</server-group>

You can also define them at the server level if you need some setting only on a single server in the server group. See the host.xml for an example of that.

like image 133
James R. Perkins Avatar answered Sep 23 '25 07:09

James R. Perkins