• No results found

Server groups

In document Jboss Admin Guide v7.1 (Page 156-160)

5 Domain setup

5.3 Server groups

The domain controller defines one or more server groups and associates each of these with a profile and a socket binding group, and also :

JBoss Community Documentation Page 157 of 660 <server-groups>

<server-group name="main-server-group" profile="default"> <jvm name="default">

<heap size="64m" max-size="512m"/> <permgen size="128m" max-size="128m"/> </jvm>

<socket-binding-group ref="standard-sockets"/> </server-group>

<server-group name="other-server-group" profile="bigger"> <jvm name="default">

<heap size="64m" max-size="512m"/> </jvm>

<socket-binding-group ref="bigger-sockets"/> </server-group>

</server-groups>

(See domain/configuration/domain.xml)

The domain controller also defines the socket binding groups and the profiles. The socket binding groups define the default socket bindings that are used:

<socket-binding-groups>

<socket-binding-group name="standard-sockets" default-interface="public"> <socket-binding name="http" port="8080"/>

[...]

</socket-binding-group>

<socket-binding-group name="bigger-sockets" include="standard-sockets" default-interface="public">

<socket-binding name="unique-to-bigger" port="8123"/> </socket-binding-group>

</socket-binding-groups>

(See domain/configuration/domain.xml)

In this example the bigger-sockets group includes all the socket bindings defined in the groups and then defines an extra socket binding of its own.

standard-sockets

A profile is a collection of subsystems, and these subsystems are what implement the functionality people expect of an application server.

<profiles>

<profile name="default">

<subsystem xmlns="urn:jboss:domain:web:1.0">

<connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/> [...]

</subsystem>

<\!-\- The rest of the subsystems here \--> [...]

</profile>

<profile name="bigger">

<subsystem xmlns="urn:jboss:domain:web:1.0">

<connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/> [...]

</subsystem>

<\!-\- The same subsystems as defined by 'default' here \--> [...] <subsystem xmlns="urn:jboss:domain:fictional-example:1.0"> <socket-to-use name="unique-to-bigger"/> </subsystem> </profile> </profiles> (See domain/configuration/domain.xml)

Here we have two profiles. The bigger profile contains all the same subsystems as the default profile (athough the parameters for the various subsystems could be different in each profile), and adds the

subsystem which references the socket binding.

fictional-example unique-to-bigger

5.4 Servers

The host controller defines one or more servers:

<servers>

<server name="server-one" group="main-server-group">

<\!-\- server-one inherits the default socket-group declared in the server-group \--> <jvm name="default"/>

</server>

<server name="server-two" group="main-server-group" auto-start="true"> <socket-binding-group ref="standard-sockets" port-offset="150"/> <jvm name="default">

<heap size="64m" max-size="256m"/> </jvm>

</server>

<server name="server-three" group="other-server-group" auto-start="false"> <socket-binding-group ref="bigger-sockets" port-offset="250"/>

</server> </servers>

JBoss Community Documentation Page 159 of 660

and both are associated with so that means they both

server-one server-two main-server-group

run the subsystems defined by the default profile, and have the socket bindings defined by the

socket binding group. Since all the servers defined by a host will be run on the same standard-sockets

physical host we would get port conflicts unless we used <socket-binding-group for . This means that

ref="standard-sockets" port-offset="150"/> server-two server-two will use the socket bindings defined by standard-sockets but it will add 150 to each port number defined, so the value used for http will be 8230 for server-two.

will not be started due to its . The default value if no

server-three auto-start="false" auto-start

is given is true so both server-one and server-two will be started when the host controller is started.

belongs to , so if its were changed to it would

server-three other-server-group auto-start true

start up using the subsystems from the bigger profile, and it would use the bigger-sockets socket binding group.

5.4.1 JVM

The host controller contains the main jvm definitions with arguments:

<jvms>

<jvm name="default">

<heap size="64m" max-size="128m"/> </jvm>

</jvms>

(See domain/configuration/host.xml)

From the preceeding examples we can see that we also had a jvm reference at server group level in the domain controller. The jvm's name must match one of the definitions in the host controller. The values supplied at domain controller and host controller level are combined, with the host controller taking precedence if the same parameter is given in both places.

Finally, as seen, we can also override the jvm at server level. Again, the jvm's name must match one of the definitions in the host controller. The values are combined with the ones coming in from domain controller and host controller level, this time the server definition takes precedence if the same parameter is given in all places.

Following these rules the jvm parameters to start each server would be

Server JVM parameters

server-one -XX:PermSize=128m -XX:MaxPermSize=128m -Xms64m -Xmx128m

server-two -XX:PermSize=128m -XX:MaxPermSize=128m -Xms64m -Xmx256m

In document Jboss Admin Guide v7.1 (Page 156-160)