DevPortal

How do I Configure J2EE Server Cluster Using NodeCreator?


You can configure a J2EE cluster using the NodeCreator class. To run the NodeCreator Utility, run NodeCreator.bat (for Windows) or NodeCreator.sh (for Unix) located at <install_dir>\server\bin\ by passing the following values:

Table 1: Operations that can be performed using the Node Creator class
Operation Description


-createj2ee To create a Standalone J2EE node.
-createj2eecluster To create multiple J2EE nodes in a cluster.
-createjms To create a Message Server node.
-createjmscluster To create multiple Message Server nodes in a cluster.


The various values (given as parametername value format) required to perform the above operations are:

Table 2: Values for the Node Creator class
Value Description


-name Names of the nodes. In case of a cluster, the names are separated by a comma ‘,’.
-ip The IP of the machine on which this node is being created. The default value is local host. In case of a cluster, the IPs are separated by a comma ‘,’.
-namingport Naming ports of the nodes. In case of a cluster, the ports are separated by a comma ‘,’.
-httpport HTTP ports of the nodes. In case of a cluster, the ports are separated by a comma ‘,’.
-clustername In case of a cluster, the name of the cluster.


You can also specify the System Property install.root, if the program is not being run from the Server root.

Example for creating a J2EE cluster:

NodeCreator.bat/NodeCreator.sh -createj2eecluster -name mynode1,mynode2 -namingport 9191,9292 -httpport 8181,8282 -clustername mycluster

The help snippet that shows up on the command shell is as follows:

Usage: nodecreator [operation] [option value]
Operations can be any one of the following: -createj2ee, -createj2eecluster, -createjms, -createjmscluster, -createlb, -removej2ee, -removej2eecluster, -removejms, -removejmscluster

Option value pairs include:
Options Description


-ip IPs of the nodes separated by ",".
-name names of the nodes separated by ",".
-namingport naming-ports of the nodes separated by ",".
-httpport http-ports of the nodes separated by ",".
-clustername name of the cluster(required only for a cluster).
-topology name of the topology file generated as a result of configuring the cluster through nodecreator(required only for LB).
-force NA. -force is used to tell the utility to drop the table if it already exists.


The above options create a standalone server or a cluster or LB with all BOTH nodes with in-memory/file persistence.

Advanced Usage:

nodecreator -config_topology creates a StandAlone/Cluster based on the configuration defined in the file. This can be used both to convert existing nodes as well as create new nodes and include all in the cluster.

nodecreator -remove -topology removes the cluster/standalone nodes as defined in the topology.

nodecreator -config_topology -configuration -writetoplogy

The above can be used to add resources while creation of the server and create a topology file in the same directory as configuration toplogy file. The configuration toplogy file can be used for launching or removing the the nodes (see launcher help by runnning launcher.) Refer to relevant XML templates in server templates directory.

Examples using commandline arguments:

Creating/Removing J2EE Standalone: nodecreator (-createj2ee/-removej2ee) -ip 192.168.1.5 -name node1 -namingport 9191 -httpport 8181

Creating/Removing J2EE Cluster: nodecreator (-createj2eecluster/-removej2eecluster) -ip 192.168.1.5,192.168.1.3 -name node1, node2 -namingport 9191, 9191 -httpport 8181, 8181 -clustername testCluster

Examples using XML files:

Creating/Removing J2EE standalone/cluster: nodecreator (-remove) -config_topolgy <%absolute path to configuration topology xml %> -configuration <%absolute path to configuration xml%> -writetopology

Creating a load balancer: nodecreator -createlb -name lbnode -ip 192.168.1.5 -namingport 9191 -httpport 8181 -topology <%absolute path to the topology file generated above as a result of writetopology option%>

Note: Please see the configuration and topology xml's in the install_dir\template folder of the server for further details.


Related Topics:

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