Sun Java System Message Queue 4.1 Administration Guide

Setting the Cluster Configuration

Like all broker properties, the cluster configuration properties can be set individually for each broker in a cluster, either in its instance configuration file (config.properties) or by using the -D option on the command line when you start the broker. For example, to create a conventional cluster consisting of brokers at port 9876 on host1, port 5000 on host2, and the default port (7676) on ctrlhost, you could include the following property in the instance configuration files for all three brokers:

   imq.cluster.brokerlist=host1:9876,host2:5000,ctrlhost

Notice, however, that if you need to change the cluster configuration, this method requires you to update the instance configuration file for every broker in the cluster. For consistency and ease of maintenance, it is generally more convenient to collect all of the shared cluster configuration properties into a central cluster configuration file that all of the individual brokers reference. This prevents the settings from getting out of agreement and ensures that all brokers in a cluster share the same, consistent configuration information. In this approach, each broker’s instance configuration file must set the imq.cluster.url property to point to the location of the cluster configuration file: for example,

   imq.cluster.url=file:/home/cluster.properties

The cluster configuration file then defines the shared configuration properties for all of the brokers in the cluster, such as the list of brokers to be connected (imq.cluster.brokerlist), the transport protocol to use for the cluster connection service (imq.cluster.transport), and optionally, for conventional clusters, the address of the master broker (imq.cluster.masterbroker). The following code defines the same conventional cluster as in the previous example, with the broker running on ctrlhost serving as the master broker:

   imq.cluster.brokerlist=host1:9876,host2:5000,ctrlhost
   imq.cluster.masterbroker=ctrlhost