JBoss EAP 6 management plug-in for JON is unable to discover a host controller's managed servers if its domain host name attribute is changed

Solution Unverified - Updated -

Environment

  • Red Hat JBoss Operations Network (ON) 3.1.2
  • Red Hat JBoss Enterprise Application Platform (EAP) 6
  • JBoss EAP 6 management plug-in
  • JBoss EAP domain or host controller resource
  • Domain host connection setting value displayed under host controller resource dose not match value set in host controller's configuration -- for example, in host.xml

Issue

  • Unable to reset host controller to new name
  • Unable to discover managed servers after updating naming scheme of domain/host controller
  • None of the host controllers online anymore
  • None of the managed servers under host controllers online anymore
  • The configuration for host controller show the wrong host controller names
  • I am unable to reconfigure the domain host value
  • How can I change the domain host value of a host controller resource?

Resolution

The domain host connection setting property is read-only and can not be modified from the user interface (UI) for an existing host controller or its child resources. Red Hat Bugzilla 1015334 has been captured to identify this limitation.

You should avoid changing the JBoss EAP host controller's host name attribute unless the host controller can be removed from inventory and rediscovered.

Although it is not recommended, you can use the JBoss ON remote client API or command-line interface (CLI) to change the affected resource's PluginConfiguration and update the value of the domainHost property. For example:

var config = ConfigurationManager.getPluginConfiguration(resourceId);
config.setSimpleValue("domainHost","MyNewDomainHostName");
ConfigurationManager.updatePluginConfiguration(resourceId, config);

This will allow the host controller resource in inventory to discover its managed servers using the new domain host value. The managed servers found under the original domain host name will remain in inventory as unavailable. You can either disable the original resources or remove them from inventory if they are no longer needed. The attached JBoss ON CLI script serves as an example of how to update the domainHost configuration value for an affected resource.

Root Cause

The domain host connection setting is used when performing discovery of a host controller's managed servers and other resources. As it is not expected to change, it is stored in a read-only form with the host controller resource when the host controller is initially discovered and added to inventory. When a managed server discovery scan is executed, the JBoss EAP 6 plug-in executes a management query again the EAP host controller using the value stored for domain host. For each discovered managed server, the complete address, which includes the domain host value, is stored with the managed server resource so that it can be queried directly. For example, if the host controller's name is master, a query similar to the following is executed using the JBoss EAP management API:

[domain@localhost:9999 /] /host=master:read-children-resources(child-type=server-config)
{
    "outcome" => "success",
    "result" => {
        "server-one" => {
            "auto-start" => true,
            "cpu-affinity" => undefined,

This may return multiple servers with addresses similar to:

host=master,server-config=server-one
host=master,server-config=server-two
host=master,server-config=server-three

These addresses are what is stored in the managed server resource's connection settings and make up the unique identifier assigned to the resource.

If we then change the host name attribute for this host controller by updating its host.xml file:

<?xml version='1.0' encoding='UTF-8'?>

<host name="newMaster" xmlns="urn:jboss:domain:1.4">

    <management>
        <security-realms>
            <security-realm name="ManagementRealm">
                <authentication>
                    <local default-user="$local" />
                    <properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>
                </authentication>
    ...

Any query or operation that is attempted for the existing managed servers will now fail:

[domain@localhost:9999 /] /host=master/server-config=server-one:read-resource()
{
    "outcome" => "failed",
    "failure-description" => "JBAS014883: No resource definition is registered for address [
    (\"host\" => \"master\"),
    (\"server-config\" => \"server-one\")
]",
    "rolled-back" => true
}

This is because the address is no longer valid. Furthermore, an attempt to discovery managed servers for this host controller will also fail for the same reason:

[domain@localhost:9999 /] /host=master:read-children-resources(child-type=server-config)
Failed to get the list of the operation properties: "JBAS014883: No resource definition is registered for address [("host" => "master")]"

The only way this host controller resource will be able to successfully execute a managed server discovery scan is for the resource's domain host value set on its connection settings page to be changed to match what the EAP host controller is actually using. However, as this is only set at discovery time, the value can not be changed.

Diagnostic Steps

  • Review the EAP server's host configuration file for the current domain host name value:

    <?xml version='1.0' encoding='UTF-8'?>
    
    <host name="MyDomainHostNameValue" xmlns="urn:jboss:domain:1.4">
    
        <management>
            <security-realms>
                <security-realm name="ManagementRealm">
                    <authentication>
                        <local default-user="$local" />
                        <properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>
                    </authentication>
                </security-realm>
                <security-realm name="ApplicationRealm">
    

    If no value is defined for the name attribute of the host element, a default value will be used as described in the configuration schema.

  • Review the connection settings page of the affected host controller resource and compare the Domain Host value to the value defined in the EAP host controller's host configuration file.

    If these two values are different, this issue will apply.

Attachments

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments