Identify the following machines:
MachineA — Has both the load balancer and the administration server.
MachineB, MachineC, MachineD and MachineE — Has the administration node and the web server instances running.
Install Administration Server on MachineA.
See To Set Up a Server Farm for information on installing an administration server. The typical installation process will also install a web server instance. For this scenario, we will not be using that instance.
Install the Administration Node on MachineB, MachineC, MachineD and MachineE.
Install the administration node on all the 4 machines. Register the administration nodes with the administration server.
Configure the Web Application.
Enable session replication for the web application. Modify WEb-INF/sun-web.xml file as follows:
<session-manager persistence-type="replicated"/> |
Configure the Instances.
Launch wadm.
wadm --host MachineA --port 8089 |
Create a new configuration for the load balancer.
wadm> create-config --http-port=8080 --server-name=SampleCluster lb |
Set up reverse proxy (Load balancer).
wadm> create-reverse-proxy --config=lb --vs=lb -uri-prefix=/ --server="http://MachineB:8080,http://MachineC:8080, ttp://MachineD:8080,http://MachineE:8080" |
Create an instance.
wadm> create-instance --config=lb MachineA |
Deploy the Configuration.
wadm> deploy-config lb wadm> start-instance --config=lb |
Create and Start The Cluster.
Create a new Configuration with four instances.
Create a new configuration for the cluster.
wadm> create-config --http-port=8080 --server-name=SampleCluster clusterOf4 |
Enable Session Replication.
wadm> set-session-replication-prop --config=clusterOf4 enabled=true |
Add your web application.
wadm> add-webapp --config=clusterOf4 --uri=/simple webapps-simple.war |
Create the instances.
wadm> create-instance --config=clusterOf4 MachineB MachineC MachineD MachineE |
Start the cluster.
wadm> start-instance --config=clusterOf4 |
If host name is not specified for the start-instance command, this action will start instances on all the nodes where the configuration is deployed.