Configuring a host with two servers bound to different IP's
bernard.tison Feb 13, 2012 8:18 AMhi,
I am trying to configure a host with two servers, each server bound to a different IP address.
The relevant fragments from domain.xml and host.xml:
domain.xml:
{code:xml}
<interfaces>
<interface name="management"/>
<interface name="public"/>
</interfaces>
<server-groups>
<server-group name="main-server-group" profile="default">
<socket-binding-group ref="standard-sockets"/>
</server-group>
</server-groups>
{code}
host.xml:
{code:xml}
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
</interfaces>
<servers>
<server name="server-one" group="main-server-group">
<interface name="public">
<inet-address value="192.168.1.20"/>
</interface>
</server>
<server name="server-two" group="main-server-group">
<interface name="public">
<inet-address value="192.168.1.21"/>
</interface>
</server>
</servers>
{code}
However, when I start up my domain, I got a stack trace saying that the "public" interface is already defined.
[Host Controller] 13:04:46,191 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("add") failed - address: ([
[Host Controller] ("host" => "node1"),
[Host Controller] ("server-config" => "server-two"),
[Host Controller] ("interface" => "public")
[Host Controller] ]): org.jboss.msc.service.DuplicateServiceException: Service jboss.network.public is already registered
[Host Controller] at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154) [jboss-msc-1.0.1.GA-redhat-1.jar:1.0.1.GA-redhat-1]
[Host Controller] at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:226) [jboss-msc-1.0.1.GA-redhat-1.jar:1.0.1.GA-redhat-1]
[Host Controller] at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560) [jboss-msc-1.0.1.GA-redhat-1.jar:1.0.1.GA-redhat-1]
[Host Controller] at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.1.GA-redhat-1.jar:1.0.1.GA-redhat-1]
(remainder of the stacktrace removed)
The only way till now I found to make this setup work is by defining a "public1" and a "public2" interface, and configure these in server-one and server-two respectively.
However, this requires me to duplicate the socket-binding-group definitions in domain.xml, as the socket-binding-group is bound to an interface, so I need a socket-binding group for interface "public1" and a socket-binding group for interface "public2".
For two servers this is doable, but become quite tedious if I would need to configure more servers on one box.
Is there another way to achieve this?
Thx
Bernard