![]() |
|
To create a JMS Cluster you need to provide a topology.xml file to the NodeCreator as an argument. The topology.xml file contains information such as the node name, IP address, naming port, and HTTP port.
Table 1: Creating Nodes in a JMS Cluster
| NodeName | IP Address | Naming Port | HTTP Port |
| jms1 | localhost | 9292 | 8282 |
| jms2 | localhost | 9393 | 8383 |
The name of the cluster should be specified through the cluster name="JMSCluster1" type="JMS" tag with the type setting to JMS under the root element topology.
Multiple nodes can be specified in the topology.xml file through the node tag (under <topology> <cluster <create-nodes>) like the following:
<topology>
<cluster name="JMSCluster1" type="JMS">
<create-nodes>
<node name="jms1" type="jms-cluster">
<ip>localhost</ip>
<naming-port>9292</naming-port>
<http-port> 8282</http-port>
</node>
<node name="jms2" type="jms-cluster">
<ip>localhost</ip>
<naming-port>9393</naming-port>
<http-port> 8383</http-port>
</node>
</create-nodes>
</cluster>
</topology>
The type of the node must be jms-cluster as shown above.
topology.xml file also contains cluster configuration persistence information for the cluster creation. The cluster configuration can be either file or db.
nodes\<node-name>\config directory). In this case, if a change is required in one of the server configuration files, manual modification must be done in all the nodes. In these cases, the configuration of the nodes might not be in synch properly.
To configure the cluster configuration persistence to file type, add the following tag with the type as file under the <topology> <cluster> tag in the topology.xml file.
<configuration-persistence type="file"> </configuration-persistence>
To make configuration changes in db-based cluster configuration persistence, use the following steps:
configuration.xml in one of the nodes.-uploadconfig as command line argument. This uploads the localconfiguration into the centralized database.To configure the cluster configuration persistence to db type, you need to specify the Database Connection Details and the name of the table in which the cluster configuration should be stored.
A sample is given below with the type set to db.
<configuration-persistence type="db">
<property name="driver" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@db:1521:db"/>
<property name="user" value="scott"/>
<property name="password" value="tiger"/>
<property name="tablename" value="JMS_CLUSTER_PERSISTENCE"/>
</configuration-persistence>
In this case, if the given table JMS_CLUSTER_PERSISTENCE already exists in the given database, it throws an exception. If you want to drop the table, use the -force command as an argument to the command line to the node creator.
Now the topology.xml file looks like the following:
<?xml version="1.0" encoding="UTF-8"?>
<topology>
<cluster name="JMSCluster1" type="JMS">
<create-nodes>
<node name="jms1" type="jms-cluster">
<ip>localhost</ip>
<naming-port>9292</naming-port>
<http-port> 8282</http-port>
</node>
<node name="jms2" type="jms-cluster">
<ip>localhost</ip>
<naming-port>9393</naming-port>
<http-port>8383</http-port>
</node>
</create-nodes>
<configuration-persistence type="db">
<property name="driver" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@db:1521:db"/>
<property name="user" value="scott"/>
<property name="password" value="tiger"/>
<property name="tablename" value="JMS_CLUSTER_PERSISTENCE"/>
</configuration-persistence>
</cluster>
</topology>
Related Topics:
| © Pramati Technologies 2007 | Runs on Pramati Server | Feedback | Legal |