[wildfly-dev] WildFly Server IP Address and Port

Brian Stansberry brian.stansberry at redhat.com
Wed Sep 2 16:42:51 EDT 2015


I believe you are referring to the "external_addr" configuration 
property available for JGroups transport protocols:

http://www.jgroups.org/manual/html/protlist.html#Transport

I didn't follow the development of that feature in detail, but I assume 
the way it works is the JGroups discovery protocols advertise the value 
of that property if it's configured. Otherwise they advertise the usual 
bind_addr.

That's specific to JGroups discovery though. It's not a general purpose 
service endpoint publication and discovery thing. I've seen systems like 
Kubernetes used for that kind of orchestration.

On 9/2/15 8:23 AM, Bob McWhirter wrote:
> We do support some way to advertise (via jgroups) a different host/port
> than the one that it is actually bound to, right?
>
> I thought we had to add that functionality to support OpenShift, where
> the internal IP given to the AS is different than the externally visible
> host/port for clustering.
>
> On Wed, Sep 2, 2015 at 10:20 AM, Brian Stansberry
> <brian.stansberry at redhat.com <mailto:brian.stansberry at redhat.com>> wrote:
>
>     On 9/1/15 6:52 PM, Arun Gupta wrote:
>     >>>> Is this scenario different from running multiple WildFly instances on a
>     >>>> single machine in a non-Docker setup?
>     >>>
>     >>>
>     >>> Good point, they are the same.
>     >>>
>     >>
>     >> Reading a bit more, it seems Docker gives each container its own address,
>     >> visible to the container via the eth0 interface:
>     >>
>     >>https://docs.docker.com/articles/networking/
>     >
>     > Those IP addresses are not available externally AIU.
>     >
>
>     Ok, I'm getting clear on your scenario. Thanks.
>
>     >>> So, if WildFly runs with -b <IP_ADDRESS> then the utility above will
>     >>> give the correct address and port?
>     >>>
>     >>
>     >> Yes, assuming IP_ADDRESS != 0.0.0.0, the server config is using a
>     >> socket-binding named "http" for the web server, and the web server
>     >> address/port is the one you want.
>     >>
>     >
>     >              ObjectName http = new
>     > ObjectName("jboss.as:socket-binding-group=standard-sockets,socket-binding=http");
>     >              hostName = (String) mBeanServer.getAttribute(http,"boundAddress");
>     >              hostPort = (Integer) mBeanServer.getAttribute(http,"boundPort");
>     >
>     >
>     > seems to be returning correct HTTP host/port. However
>     >
>     >              ObjectName https = new
>     > ObjectName("jboss.as:socket-binding-group=standard-sockets,socket-binding=https");
>     >              hostSecurePort = (int) mBeanServer.getAttribute(https, "boundPort");
>     >
>     > is throwing NPE.
>     >
>     > Will this only be available if HTTPS port is accessible?
>     >
>
>     Those attributes will only be non-null if the https socket-binding is
>     used by some service (e.g. an undertow listener.) If the configuration
>     doesn't require the socket binding to be used, then the resolution of
>     the socket binding's config data to an actual IP address will not occur.
>
>      > Arun
>     >
>     >
>     >
>
>
>     --
>     Brian Stansberry
>     Senior Principal Software Engineer
>     JBoss by Red Hat
>     _______________________________________________
>     wildfly-dev mailing list
>     wildfly-dev at lists.jboss.org <mailto:wildfly-dev at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/wildfly-dev
>
>


-- 
Brian Stansberry
Senior Principal Software Engineer
JBoss by Red Hat


More information about the wildfly-dev mailing list