3.2. Centralized Configuration, Deployment, and Management
Abstract
Red Hat AMQ incorporates Fuse Fabric to enable the creation of clusters of brokers called fabrics. When brokers are deployed into a fabric they can be configured, deployed, and managed from a central location. In addition, brokers in a fabric can capitalize on the fabric's ability provide dynamic failover among the brokers in a fabric.
Overview
Red Hat AMQ allows you deploy a group of brokers into a fabric. All of the brokers in a fabric are managed by a distributed Fabric Ensemble that stores runtime and configuration information for all of the brokers in the fabric. Using this information the ensemble enables you to manage large deployments by:
- automating the configuration of failover groups, networks of brokers, and master/slave groupsThe ensemble knows the connection details for all of the brokers in the fabric and uses that information to configure brokers into different configurations. Because the information is updated in real time, the broker configurations are always correct.
- automating client connection and failover configurationWhen brokers are configured into a fabric, messaging clients can use a special discovery protocol that discovers broker connection details from the fabric's ensemble. The fabric discovery connection will also automatically failover to other brokers in a failover cluster without needing to know any details about what brokers are deployed.
- centralizing configuration informationAll of the configuration for each container in the fabric, including details about which bundles are deployed, are stored in the ensemble. Any of the configurations can be edited from a remote location and directly applied to any container in the fabric.
- simplifying the enforcement of common configuration policiesThe ensemble organizes configuration information into profiles that can inherit from each other. This makes it easy to enforce common policies about how brokers need to be configured using base profiles.
- centralizing management and monitoring functionalityUsing the management console or the AMQ command console you can update configuration profiles, deploy new containers, shutdown containers, and get runtime metrics for any of the containers in the fabric
Anatomy of a fabric
Figure 3.1, “A Fabric” shows the components of a fabric with seven brokers and an ensemble consisting of three servers.
Figure 3.1. A Fabric
![A Fabric](https://access.redhat.com/webassets/avalon/d/Red_Hat_AMQ-6.3-Product_Introduction-en-US/images/8e0685e06f6e23d82eead6ac4aa1f8e3/fabric.png)
The key components of the fabric are:
- Fabric Ensemble—a group of one or more Fabric Servers that work together to maintain the registry and other services that provide the glue for the fabric
- Fabric Server—a container that hosts the runtime functionality for the ensemble
- Fabric Container—an Apache Karaf container that is managed by a Fabric Agent
- Fabric Agent—a process that communicates with the ensemble to manage the container's configuration
Fabric Ensemble
The Fabric Ensemble, based on Apache Zookeeper, maintains two databases:
- centralized configuration—stores the configuration profiles for all of the containers in the fabric. The configuration profiles are organized by versions and allow for inheritance between profiles.
- runtime information—stores status for all of the containers in the fabric. The runtime information stored in the database includes the status of the container, the address of any endpoints and messaging destinations exposed by the container, the JMX URL used to monitor the container, the number of client's accessing services deployed in the container, etc.
The ensemble is intended to be distributed across multiple machines to provide a level of high-availability. The servers in the ensemble use a quorum policy to elect the master server and will re-elect a new master when the current master fails. To ensure optimal performance of the ensemble you should deploy an odd number of Fabric Servers to maintain the ensemble. The more servers in the ensemble, the more failures it can endure.
The ensemble is dynamically updated by the Fabric Agents running in the containers that make up the fabric. The agents routinely report the status of their container to the ensemble. Configuration profiles are also updated dynamically when they are edited.
Profiles
A profile is a collection of configuration data that defines the runtime parameters for a container. It contains details about:
- features—XML specifications that define a collection of bundles, jars, and other artifacts needed to implement a set of functionality
- bundles—the OSGi bundles or Fuse Application Bundles to load into a container
- repositories—the URIs from which the container can download artifacts
- configuration files—OSGI Admin PIDs that are loaded by the container's OSGi admin service and applied to the services running in the container
Profiles are additive and can inherit properties from parent profiles. This makes it possible to create standardized configurations that can be used throughout your deployment. The profile for a specific container will inherit the standard configuration from the base profile and add any specific settings needed to tailor the container for its specific deployment environment.
Profiles are organized into versions. A version is a collection of profiles. Creating a new version copies all of the profiles from the parent version and stores them in a new collection. A Fabric Container can access only one version at a time, so changes made to the profiles in one version will only effect the containers that are assigned to the version being edited. This makes it easy to roll out changes to a fabric incrementally.
Fabric Agents
A Fabric Agent is the link between the ensemble and a Fabric Container. It communicates with the ensemble to:
- manage a container's configuration and provisioning—the agent regularly checks to see what profiles are assigned to the container and if the container is properly configured and running the appropriate set of services. If there is a discrepancy, the agent updates the container to eliminate the discrepancy. It flushes any extraneous bundles and services and installs any bundles and services that are missing.
- updating the ensemble's runtime information—the agent reports back any changes to the container's runtime status. This includes information about the containers provisioning status, the endpoints and messaging destination exposed by the container, etc.
Working with a fabric
One of the advantages of a fabric is that you can manage it from any of the containers in the fabric. The fabric command shell interacts directly with the ensemble, so all changes are immediately picked up by all of the containers in the fabric.
You can also use the Web-based Fuse Management Console, included in the AMQ distribution, to work with a fabric. When AMQ is running, the Fuse Management Console is available at
http://localhost:8181
. The Fuse Management Console allows you to:
- add containers to a fabric
- create profiles and versions
- edit profiles
- assign profiles to containers
- monitor the health of all containers in a fabric
For AMQ, the Fuse Management Console allows you to manage and monitor broker instances, destinations, and consumers. For example, you can:
- create and delete queues and topics
- inspect all MBeans registered by AMQ
- browse the messages on a queue or topic
- send messages to a queue or topic
- graphically view the producers, destinations, and consumers for all queues or topics or for a single queue or topic
- chart the performance metrics of all queues and topics or for a single queue or topic