wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes Does jboss bind to 0.0.0.0 on a non-clustered server ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Does jboss bind to 0.0.0.0 on a non-clustered server ?" Watch "Does jboss bind to 0.0.0.0 on a non-clustered server ?" New topic
Author

Does jboss bind to 0.0.0.0 on a non-clustered server ?

Anoop Nair
Ranch Hand

Joined: Oct 29, 2008
Posts: 70
Hi All,

I had previously posted here to know how I can make JBoss listen on two IPs.

I tried that and it worked. However, when I try the same thing on another JBoss instance it doesnt work.
The only difference I noted was that the first one was a clustered server whereas the second one is a default server.

Am I missing something here ?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10145
    
165

Anoop Nair wrote:
I tried that and it worked. However, when I try the same thing on another JBoss instance it doesnt work.


What version of JBoss AS? Which Operating System? What exact command do you use to start the server? What problem do you see?

[My Blog] [JavaRanch Journal]
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Are all these JBoss AS instances on the same system? If so, what -b option did you use for each instance? If you are going to run more that 2 instances you first need to add additional IP addresses to your network card. This also means that you cannot use DHCP to assign IP addresses.

(The above assumes that you are still trying to one one server per IP address, rather that using different port bindings, as indicated by your other post. )


JBoss In Action
Anoop Nair
Ranch Hand

Joined: Oct 29, 2008
Posts: 70
Thanks Jaikiran and Peter for your responses.

I am using JBoss AS 4.3 on Linux.

Three JBoss instances are running on the same system on different ports. The system has two IP addresses, IP1 and IP2. Ex. IP1 = 1.1.1.1 and IP2 = 2.2.2.2.

Instance1 is a clustered server (CL1). The binding 0.0.0.0 works with this one. The other two are instances of the default server (DF1 and DF2). The binding works for one of the default servers (DF1).

After starting DF2 when I do http://2.2.2.2:8080, the console doesnt come up. However, if I do http://1.1.1.1:8080 it comes up.

The server is started using run.sh command with the below arguments
-Djboss.server.log.dir
-Djboss.server.base.url
-Djboss.server.base.dir
-b 0.0.0.0

I am not able to figure out what could be the difference in the configuration of the two default servers.

I also tried running DF2 with -b IP2.
However, this also doesnt work. In this case the console doesnt come up on doing trying IP1 as well, which was expected.
Anoop Nair
Ranch Hand

Joined: Oct 29, 2008
Posts: 70
When running DF2 with -b <IP2>, on stopping the server I get the following exception:


Exception in thread "main" javax.naming.NameNotFoundException: jmx not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:581)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:589)
at org.jnp.server.NamingServer.getObject(NamingServer.java:595)
at org.jnp.server.NamingServer.lookup(NamingServer.java:313)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.Shutdown.main(Shutdown.java:214)


Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

It sounds like you are using both the port binding mechanism and multiple IP addresses to run the various servers. Are you sure that you are using the right combination of port numbers and IP addresses when attempting to access them? Personally, I would not mix the two methods, nor would I bind any server to 0.0.0.0 when using multiple IP address. In other words, I would either:

a) bind every server to 0.0.0.0 and use different ports
b) bind each server to its own distinct IP address (each using the same ports) - this option requires a separate physical IP address for each server

I am also puzzled by your use of the -Djboss.server.xxx options on the command line. Why are you using those instead of "-c xxx" to reference the different directories under jboss_home/server? I don't know if this is causing a problem or not, but the -c option is the preferred mechanism.

I recommend that you examine the console log for each of the servers to ensure that each one is binding to the IP address and port to which you think it is. A few lines before the "started in xxx seconds" message there is another log entry that identifies the HTTP port and its IP address.

Also, how are you firewall settings? Are the IP address and port combinations open?
Anoop Nair
Ranch Hand

Joined: Oct 29, 2008
Posts: 70
Thanks Peter,

There was indeed a firewall issue. Seems like the IP and port combination was not open.

Personally, I would not mix the two methods, nor would I bind any server to 0.0.0.0 when using multiple IP address. In other words, I would either:

a) bind every server to 0.0.0.0 and use different ports
b) bind each server to its own distinct IP address (each using the same ports) - this option requires a separate physical IP address for each server

My requirement is that only one of the servers should be listening on both the IPs, the others shouldnt be. Could you please point me to some article so that I can understand this ?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

My requirement is that only one of the servers should be listening on both the IPs, the others shouldnt be.

I would have two sets of port bindings - one for use with 0.0.0.0 and the other for use with the specific IP addresses.

Could you please point me to some article so that I can understand this ?

http://community.jboss.org/wiki/ConfiguringMultipleJBossInstancesOnOnemachine
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does jboss bind to 0.0.0.0 on a non-clustered server ?