DevPortal

How do I Configure J2EE Server Cluster Using XMLs?


To configure a J2EE cluster using XMLs use the following steps:

  1. Create a new folder, say j2ee1 under the <install_dir>\server\nodes.
  2. Copy the config directory from <install_dir>\server\nodes\<node_name> and place it under <install_dir>\server\nodes\j2ee1. This copies the server-config.xml.
  3. Copy the cluster_config.xml from <install_dir>\server\templates and place it under <install_dir>\server\nodes\j2ee1.
  4. Open the server-config.xml, and make the following changes:
  5. Table 1: Modifying the server-config.xml for configuring a J2EE Server Cluster
    Tag with original value Change value to


    <server-node name="default" type="J2EE"> <server-node name="j2ee1" type="j2ee">
    <!-- <belongs-to-cluster>MyCluster</belongs-to-cluster>--> <belongs-to-cluster>MyJ2EECluster</belongs-to-cluster>. Note: The comment has to be removed.
    <property name="namingport" value="9191"/> <property name="namingport" value="9191"/>. Note: You can change the port value to the port being used.
    <service name="DeployService" enabled="true"> Set enabled="false" if the Service is not needed.
    <service name="WebContainer" enabled="true"> Set enabled="false" if the Service is not needed.
    <service name="EJBContainer" enabled="true"> Set enabled="false" if the Service is not needed.
    <service name="JMSService" enabled="true"> Set enabled="false" if the Service is not needed.
    <service name="ClusterService" enabled="false"> Set enabled="true".
    <configuration-persistence use="file"> <configuration-persistence use="db">
    <property name="driver" value=""/> <property name="driver" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="url" value=""/> <property name="url" value="jdbc:oracle:thin:@qadb:1521:qadb"/>
    <property name="user" value=""/> <property name="user" value="qa1"/>
    <property name="password" value=""/> <property name="password" value="qa1"/>
    <property name="tablename" value=""/> <property name="tablename" value= "mytable"/>

  6. Open the cluster-config.xml, and make the following changes:
  7. Table 2: Modifying the cluster-config.xml for configuring a J2EE Server Cluster
    Tag with original value Change value to


    <name>default</name> <name>j2ee1</name>
    <computer-name>127.0.0.1</computer-name> <computer-name>127.0.0.1</computer-name>. Note: You can change the ID of your system here.
    <naming-port>9191</naming-port> <naming-port>9191</naming-port>. Note: You can change the port value to the port being used.
    <http-port>8181</http-port> <http-port>8181</http-port>
    <node-type>BOTH</node-type> <node-type>BOTH</node-type>. Note: The type can also be set to EJB or Web.
    <backup-node>node2</backup-node> <backup-node>j2ee2</backup-node>. Note: This is the name of the node that will be used in case of a failover. This node must also be configured in the same manner as j2ee1.

Note: The number of nodes created in the XML must be equal to the number of new folders created under <install_dir>\server\nodes.


Related Topics:

© Pramati Technologies 2007 Runs on Pramati Server | Feedback | Legal