Skip navigation
2013

Farah Juma's Blog

March 2013 Previous month Next month

It's hard to believe it's already been a year since I started working at Red Hat! Time really does fly when you're having fun! I recently finished working on a domain controller discovery system for JBoss AS 8 and thought I'd give an overview of this new feature.

What is it?

When setting up a managed domain, each host controller must be configured with information that's needed to contact the master domain controller. In AS 7, this information is provided by statically configuring the master domain controller's host and port. The domain controller discovery system for AS 8 provides support for a brand new form of discovery and also allows a host controller to be configured with multiple options for contacting the master domain controller.

A new form of discovery

In addition to static discovery, a host controller can now dynamically discover a master domain controller via Amazon S3. In particular, host controllers and the master domain controller can now be configured with information needed to access an S3 bucket (sample configuration is below). When a master domain controller is started, it will write its IP address and port to an S3 file in the given bucket. Then, whenever a slave host controller needs to contact the master domain controller, it will get its IP address and port from that S3 file. If the master domain controller's IP address changes (e.g., this is common when stopping and starting an EC2 instance), the host controllers won't need to be reconfigured. They'll be able to get the new address from the S3 file.

 

Slave host controller configuration:

<domain-controller>
    <remote security-realm="ManagementRealm">
      <discovery-options>
          <discovery-option name="s3-discovery" code="org.jboss.as.host.controller.discovery.S3Discovery" module="org.jboss.as.host-controller">
            <property name="access-key" value="s3_access_key"/>
            <property name="secret-access-key" value="s3_secret_access_key"/>
            <property name="location" value="s3_bucket_name"/>
          </discovery-option>
      </discovery-options>
    </remote>
</domain-controller>

 

Master domain controller configuration:

<domain-controller>
    <local>
        <discovery-options>
            <discovery-option name="s3-discovery" code="org.jboss.as.host.controller.discovery.S3Discovery" module="org.jboss.as.host-controller">
              <property name="access-key" value="s3_access_key"/>
              <property name="secret-access-key" value="s3_secret_access_key"/>
              <property name="location" value="s3_bucket_name"/>
          </discovery-option>
      </discovery-options>
    </local>
</domain-controller>


Support for multiple discovery options

A host controller can now be configured with multiple options for contacting a master domain controller (sample configuration is below). Currently, any number of static discovery or S3 discovery options are supported. Whenever a host controller needs to contact the master domain controller, it will now loop through the provided options, in order. The first option provided should be the one that's expected to succeed. The remaining discovery options can be used in failover situations. For example, if the primary domain controller fails, a backup can be brought online as the new domain controller and the host controllers will be able to connect to it without requiring any configuration changes!

 

<discovery-options>
    <discovery-option name="option-one" code="org.jboss.as.host.controller.discovery.S3Discovery" module="org.jboss.as.host-controller">
        <property name="access-key" value="s3_access_key"/>
        <property name="secret-access-key" value="s3_secret_access_key"/>
        <property name="location" value="s3_bucket_name"/>
    </discovery-option>
    <static-discovery name="option-two" host="172.16.81.100" port="9999"/>
    <static-discovery name="option-three" host="172.16.81.101" port="9999"/>
</discovery-options>

 

You can try out this new feature by using the latest AS 8 snapshot. Enjoy!