LibraryToggle FramesPrintFeedback

Figure 3.6 shows the initial state of a JDBC master/slave group. When all of the brokers are started, one of them grabs the mutex lock on the database table and becomes the master. All of the other brokers become slaves and pause while waiting for the lock to be freed up. Only the master starts its transport connectors, so all of the clients connect to it.


Figure 3.7 shows the state of the group after the original master has shut down or failed. As soon as the master gives up the lock (or after a suitable timeout, if the master crashes), the lock on the database table frees up and another broker grabs the lock and gets promoted to master.


After the clients lose their connection to the original master, they automatically try all of the other brokers listed in the failover URL. This enables them to find and connect to the new master.

In a JDBC master/slave configuration, there is nothing special to distinguish a master broker from the slave brokers. The membership of a particular master/slave group is defined by the fact that all of the brokers in the cluster use the same JDBC persistence layer and store their data in the same database tables.

Example 3.7 shows the configuration used be a master/slave group that stores the shared broker data in an Oracle database.


[Important]Important

The persistence adapter is configured as a direct JDBC persistence layer, using the jdbcPersistenceAdapter element. You must not use the journaled persistence adapter, which is configured using the journalPersistenceAdapter element, in this scenario.

Comments powered by Disqus