In case it helps, the value of the server element's 'name' need not affect how the server identifies itself to the outside world for normal non-administrative purposes. You can configure the HostController to pass values into the server process, e.g. to set the
jboss.node.name system property, the value of which does affect how the server is identified externally for non-administrative purposes (e.g. in clustering, transaction management). Those values can be externalized and controlled using expressions. The host.xml value of the server 'name' attribute controls the value of the
jboss.server.name system property in the server process, but if that property is *directly* controlling externally visible non-administrative behavior, that's a bug. (I say 'directly' because if the
jboss.node.name property is not set, then the default value is the same as what's used for
jboss.server.name.) The 'name' attribute here just controls the address used when managing the server via the CLI etc.
For the management aspect I don't think the server name part of the address needs to be unique across hosts. The address as a whole needs to be unique, but the address includes the /host=??? part, and the value of ??? can be externally controlled, via the
jboss.host.name or
jboss.qualified.host.name system properties or via the HOSTNAME env variable.
For an example of all this, say we have this server config:
<server name="server-one" group="main-server-group">
<system-properties>
<property name="
jboss.node.name" value="${host-qualifier}-server-one" boot-time="true"/>
</system-properties>
</server>
And we launch the HC:
bin/domain.sh -Dhost-qualifier=example
You can then use the CLI to check the value of the jboss.node.name property on the server:
[domain@localhost:9990 /] /host=primary/server=server-one/core-service=platform-mbean/type=runtime:map-get(name=system-properties,key=jboss.node.name)
{
"outcome" => "success",
"result" => "example-server-one"
}
Needing to use an arbitrary property like 'host-qualifier' in the expression is unfortunate, as using properties you might already be control would be cleaner (e.g. "${
jboss.host.name}-server-one") but that doesn't work. I haven't thought of any workaround that avoids the need to do this.