Next issue with this usage ...
Starting the command "/opt/jboss/wildfly/bin/standalone.sh -b
192.168.99.100" inside the container gives the following error ...
22:27:00,265 INFO [org.xnio.nio] (MSC service thread 1-2) XNIO NIO
Implementation Version 3.3.1.Final
22:27:00,287 ERROR [org.jboss.msc.service.fail] (MSC service thread
1-1) MSC000001: Failed to start service jboss.network.public:
org.jboss.msc.service.StartException in service jboss.network.public:
WFLYSRV0082: failed to resolve interface public
at
org.jboss.as.server.services.net.NetworkInterfaceService.start(NetworkInterfaceService.java:91)
[wildfly-server-1.0.1.Final.jar:1.0.1.Final]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
[jboss-msc-1.2.6.Final.jar:1.2.6.Final]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
[jboss-msc-1.2.6.Final.jar:1.2.6.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[rt.jar:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[rt.jar:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_51]
This is expected because 192.168.99.100 is IP Address of Docker Host.
Seems like I may have to use the internal IP address. Any thoughts on
how to obtain it?
And even then, not sure if this will allow jboss-cli to return the
publicly exposed IP address, i.e. of Docker Host.
Thoughts?
Arun
On Wed, Sep 2, 2015 at 6:20 AM, Brian Stansberry
<brian.stansberry(a)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