I completely agree and part of why I want to change it.  On my machine my wifi 
and Ethernet devices sometimes swap as being first in the list and it doesn't 
seem to like that at all.  I don't know if it's because my mgmt IP is localhost 
or what, but the new mgmt host entry never takes over ownership of the previous 
hosts.  

I'd like to make it more deterministic.  Not completely sure what the algorithm 
should be.  I was thinking that I'd sort the interfaces by Mac or name and then 
look for the non-link local nic.

Actually, I can just look for the Mac of the IP set as the cluster.node.IP.  
Some stupid reason I was thinking that was in the DB, but it's (obviously?) in 
the db.propeties.  

Darren

> On Oct 26, 2013, at 4:27 PM, Marcus Sorensen <shadow...@gmail.com> wrote:
> 
> Tangent, if that's the code that comes up with mgmt server id (by Mac
> address conversion to short), its bitten me in the past. It doesn't
> tolerate new NICs well, for example in development when a mgmt server is
> also a host and a link local bridge is created. Seems bad form to just run
> ifconfig and grab the first Mac you find.
> On Oct 26, 2013 5:12 PM, "Darren Shepherd" <darren.s.sheph...@gmail.com>
> wrote:
> 
>> Is there a specific reason that in MacAddress it uses "ifconfig" or
>> other utilities to grab the Mac Address as opposed to the java API
>> java.net.NetworkInterface?  There's a comment in that code that says
>> that code was copied from some public domain utility.  So I'm guessing
>> its there just because that's what somebody wrote back before Java 6
>> introduced NetworkInteface.getHardwareAddress().  I'd like to rewrite
>> this code to use the standard API, grab the Mac deterministically and
>> also not use ifconfig which was deprecated 3 years ago.
>> 
>> Darren
>> 

Reply via email to