Partition and Node identities
dmlloyd Mar 1, 2010 11:40 PMIn Remoting 3, we introduce the concept of an "Endpoint". An Endpoint is an instance of a node in a connected graph of Remoting participants. Each Endpoint has a name which identifies it to its peers; thus one would generally ensure that the name is unique within this graph.
In an appserver setting, there would typically be a single Endpoint instance per AS instance. Thus, it meshes strongly with the notion of having a single identity per AS instance. And since it is common to have a single AS instance per host, it would appear to make sense to default the AS identity to be equivalent to the host's identity (the host name, to be more specific - not the DNS name of an interface, but the name of the host itself).
Today, we configure clustered JBossAS instances with a "jboss.partition.name" which represents the identity of the cluster of which it is a part. However as far as I've been able to figure out, we do not have a hard-and-fast concept of a node name. I would like to propose a system property "jboss.node.name" which represents the identity of the node itself. This property would have a sensible default but would also be modifiable just as partition name is today.
In terms of implementation, my few minutes of research on the topic indicate that the best way to calculate a default node name at boot would be as follows.
- Define a system property, "jboss.host.qualified.name" or just "host.qualified.name", which, if unspecified, defaults to the value of:
- the HOSTNAME env var, or if that is not specified,
- the COMPUTERNAME env var, or if that is not specified,
- the value of InetAddress.getLocalHost().getHostName(), or if that does not turn up anything,
- a default value such as "unknown-host.unknown-domain"
- Define a system property, "jboss.host.name" or just "host.name", which, if unspecified, defaults to host portion of the above property
- Define a system property, "jboss.node.name" which, if unspecified, defaults to the value of the above property
(The host name identification scheme described above has been reported to work on Windows, POSIX-like OSes, and Mac OS, barring the event of the environment being cleared for some reason, of course.)
When the Remoting Endpoint is instantiated, it will then use the value of this property to name the endpoint, which also acts as the default authentication realm for incoming connections.
The concept of a node name is also used in a few other places that I've found:
- It appears to be used by mod_jk for identification purposes
- Seems that it might be used by jgroups and/or jbcache and/or infinispan for something?
Thoughts/feedback?