Red Hat DocumentationFuse ESBToggle FramesPrintFeedback

Fault Tolerant Broker Network

Overview

Master/slave clusters and broker networks represent different levels of organization. You can include a master/slave cluster as a node in a network of brokers. Using the basic principles of making a master/slave cluster a node in a broker network, you can scale up to an entire network consisting of master/slave pairs.

When combining master/slave clusters with broker networks there are two things to remember:

  • Network connectors to a master/slave cluster use a very specific configuration of the failover protocol.

  • A broker cannot open a network connection to another member of its master/slave cluster.

Configuring the connection to a master/slave cluster

The network connection to a master/slave cluster needs to do two things:

  • Open a connection to the master broker in the master/slave cluster without connecting to the slave brokers.

  • Connect to the new master in the case of a failure.

The network connector's reconnect logic will handle the reconnection to the new master in the case of a network failure. The network connector's connection logic, however, attempts to establish connections to all of the specified brokers. To get around the network connector's default behavior, you use a failover URI to specify the list of broker's in the master/slave cluster. The failover URI only allows the connector to connect to one of brokers in the list which will be the master.

You must set the maxReconnectAttempts=0 to disable the failover protocol's reconnect logic. Not doing so will cause problems recreating the network bridges when failing over to a new master broker.

Example 17 shows a network connector configured to link to a master/slave cluster.

Example 17. Network Connector to a Master/Slave Cluster

<networkConnectors>
  <networkConnector name="linkToCluster"
                uri="static:failover:(tcp://masterHost:61002,tcp://slaveHost:61002)?maxReconnectAttempts=0"
                ... />            
</networkConnectors>

Important

maxReconnectAttempts=0 is the only failover option you can use when configuring the network connector.

Host pair with master/slave pairs

In order to scale up to a large fault tolerant broker network, it is a good idea to adopt a simple building block as the basis for the network. An effective building block for this purpose is the host pair arrangement shown in Figure 31.

Figure 31. Master/Slave Pairs on Two Host Machines

Master/Slave Pairs on Two Host Machines

The host pair arrangement consists of two master/slave pairs distributed between two host machines. Under normal operating conditions, one master broker is active on each of the two host machines. If one of the machines should fail for some reason, the slave on the other machine takes over, so that you end up with two active brokers on the healthy machine.

When configuring the network connectors, you must remember not to open any connectors to brokers in the same failover cluster. For example, the network connector for brokerB1 should be configured to connect to at most brokerA1 and brokerA2.

Network of multiple host pairs

You can easily scale up to a large fault tolerant broker network by adding host pairs, as shown in Figure 32.

Figure 32. Broker Network Consisting of Host Pairs

Broker Network Consisting of Host Pairs

The preceding network consists of eight fault tolerant pairs distributed over eight host machines. As before, you should open network connectors only to brokers outside the current failover cluster. For example, brokerA1 can connect to at most the following brokers: brokerB*, brokerC*, brokerD*, brokerE*, brokerF*, brokerG*, and brokerH* (where * matches 1 or 2).

Comments powered by Disqus