Question

What IP address will a app running in jboss use when there are multiple IPs bound to a network interface on the server running the jboss?

is there a way to force it to use a particular IP address?

Was it helpful?

Solution

Endpoints of application services running on a specific JBoss 7.x instance are bound to the ports defined in this instances socket-binding-group in your standalone.xml or domain.xml configuration file.

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
    <socket-binding name="ajp" port="8009"/>
    <socket-binding name="http" port="8080"/>
    <socket-binding name="https" port="8443"/>
    <socket-binding name="osgi-http" interface="management" port="8090"/>
    <socket-binding name="remoting" port="4447"/>
    <socket-binding name="txn-recovery-environment" port="4712"/>
    <socket-binding name="txn-status-manager" port="4713"/>
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>
    </outbound-socket-binding>
</socket-binding-group>

These sockets are defined accordingly on named interface (usually public for application services), that can be configured in various ways. An interface configuration may include the name of the NIC and the IP address which is what you requested:

<interfaces>
    ... other definitions

    <interface name="public">
        <inet-address value="10.11.12.13"/>
        <nic name="eth0" />
    </interface>       
</interfaces>

Have a look at the JBoss 7 configuration documentation (section Interfaces) for more options.

Good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top