Not binding to localhost by default in jboss-head was: Re: [jboss-dev] Clustering bootstrap still taking a long time

Brian Stansberry brian.stansberry at redhat.com
Thu Nov 8 11:38:03 EST 2007


Adrian wrote:
> I've fixed this in head.
> http://jira.jboss.com/jira/browse/JBAS-4954
> 
> But I think the code in jboss-4.2 for the defaults for other
> bind address is wrong.
> 
> It currently says:
> 
> 
>       // JBAS-4119, set the java.rmi.server.hostname if not set
>       if (System.getProperty("java.rmi.server.hostname") == null)
>       {
>          System.setProperty("java.rmi.server.hostname", "127.0.0.1");
>       }
> 
> This has two problems:
> 1) It doesn't set the other bind addresses
> 2) It doesn't necessarily agree with what the real bind address is.
> 
> In fact, it doesn't resolve the problem I'm seeing because
> it doesn't set the jgroups.bind.addr property.
> 
> In jboss-head I've made the code:
> 
>       // Fix up other bind addresses
>       String bindAddress =
> System.getProperty(ServerConfig.SERVER_BIND_ADDRESS);
>       if (System.getProperty("java.rmi.server.hostname") == null)
>          System.setProperty("java.rmi.server.hostname", bindAddress);
>       if (System.getProperty("bind.address") == null)
>          System.setProperty("bind.address", bindAddress);
>       if (System.getProperty("jgroups.bind_addr") == null)
>          System.setProperty("jgroups.bind_addr", bindAddress);
> 

Please don't do:

 >       if (System.getProperty("bind.address") == null)
 >          System.setProperty("bind.address", bindAddress);

That's a deprecated property replaced by jgroups.bind_addr; the only 
reason it's mentioned at all in Main() is in case a user set it via -D.



> Dimitris, is there a reason why you didn't fixup all
> the bind addresses (see the -b handling code) in 4.2?
> 
> On Thu, 2007-11-08 at 16:35 +0100, Adrian wrote:
>> On Thu, 2007-11-08 at 09:22 -0600, Brian Stansberry wrote:
>>> Is your server bound to your VPN interface?
>>>
>>>  > GMS: address is 10.11.14.31:32796
>> Ok, then that reveals a different problem.
>> If I add "-b localhost", I see:
>>
>> 16:28:10,188 INFO  [STDOUT] 
>> -------------------------------------------------------
>> GMS: address is 127.0.0.1:32805
>> -------------------------------------------------------
>> 16:28:12,523 INFO  [STDOUT] 
>> -------------------------------------------------------
>> GMS: address is 127.0.0.1:32807
>> -------------------------------------------------------
>>
>> ...
>>
>> 16:28:37,115 INFO  [ServerImpl] JBoss (Microcontainer) [5.0.0.Beta3
>> (build: SVNTag=JBoss_5_0_0_Beta3 date=200711081439)] Started in
>> 1m:42s:463ms
>>
>> Not great, but better! :-)
>>
>>
>> However, "-b localhost" should be the default!

-- 
Brian Stansberry
Lead, AS Clustering
JBoss, a division of Red Hat
brian.stansberry at redhat.com



More information about the jboss-development mailing list