Getting IP's or ID's of all nodes in cluster?
1 posts in topic
Flat View  Flat View

Posted By:   Mike_Landy
Posted On:   Sunday, November 10, 2002 07:38 AM


Does java.net package contain any classes that would
tell me IP addresses or other identifiers of all the nodes and clones in a cluster?

I have a Websphere cluster containing two pyhysical computers both running a Websphere instance and a clone of them (total count 4).

Anyone know this?


Re: Getting IP's or ID's of all nodes in cluster?

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, November 11, 2002 08:49 AM

There is no such thing as a "cluster" in general TCP/IP networking, nor in general J2EE specs, not that I know of. Clustering is a general concept (I think the first I heard of it actually available in a commercial product, not just in a research project, was in DEC VMS), which is implemented in different ways by different OS's and hardware, from different vendors, also in different ways by different layers (e.g. hardware, OS kernel, or app server etc.)

So, if it is a Websphere-specific concept you are interested in, then you would need a Websphere-specific API to deal with it.

Also the concept of an identifier for a host can be simple in some cases, but can be complex and ambiguous in others.

Most operating systems have the concept of a local "host name" and usually (but not necessarily) it is tied in to the DNS (Domain Name System) and/or local "hosts" database file, hence to a "fully qualified domain name" and an IP address.

Old SunOS & early Solaris would, by default out of the box, tie the host name to NIS or NIS+ domains, instead of DNS domains (which was really really annoying when you needed something like Sendmail to work with the right resolver libraries etc.). And Microsoft Windows before W2K would sometimes tie the host name to WINS or LMHOSTS, instead of DNS (since Microsoft was late in acknowledging the Internet in the first place).

Sometimes the unique identifier of a network interface card (e.g. the "MAC address", guaranteed unique) is taken as a unique id for the host, IF the host has a single network card in it. Older license management schemes were based on the host having a single MAC address.

But this is problematic, on servers with multiple network interfaces, hence with multiple MAC addresses. And any physical host can have multiple host names, and each host name can have multiple IP addresses, even one with only a single MAC address (network interface card). And going the other way, a single IP address can have multiple hostnames associated with it, via A records, CNAME records etc. in DNS

Sun Solaris provides a proprietary "host id" concept for license management schemes to use.

I'm not sure but I think on a Solaris host with only one network interface, the "host id" will default to the MAC address, but you can change it to be whatever you like. Also on hosts with multiple MAC addresses I don't remember if it defaults to the first one in ascending numerical order,or the first one encountered when the OS boots up, etc.

Of course then there are process id's (pid's) which should be unique at one given time (they may be recycled though) among the processes running on a single host. And for multiple threads in a single process I guess there is some kind of "thread id". Solaris user threads do not map one to one onto kernel threads, unlike Microsoft Windows NT/W2K/XP user threads. SO in Solaris the multiple threads in a process are really all executing in the one single kernel thread for that process, while in Windows they really each have their own separate kernel thread dedicated to them.

And then for JVM's, which each run (I assume) in their own OS process (hence at least one kernel thread for SOlaris, or multiple kernel threads for Windows, etc.), they can have multiple class loaders, so any one "instance" e.g. of your servlet class is going to be in one instance in a class loader, in a JVM which might have multiple class loaders going, in an OS which might have multiple JVM processes, etc.

About | Sitemap | Contact