• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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. )
 
Anoop Nair
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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'm doing laundry! Look how clean this tiny ad is:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic