This document contains instruction on how to set up a simple cluster. If you wish to run the WebLogic Server clustering examples, or
are experimenting with clusters, you can use the steps in 'Creating a Simple Cluster' to get a clustered environment up and running.
A WebLogic cluster is simply a collection of WebLogic Server
instances. By hosting your applications on multiple WebLogic Servers there is less chance of failure; if one server goes down
there is another server available to back it up. A WebLogic cluster always contains one Administration Server that handles all the
administrative duties, for example, deploying applications and configuring your cluster. You do not deploy applications on the Administration
Server, you deploy applications to the Managed Servers that make up the cluster.
Your cluster can be set up in many different ways. The
only requirement is that each WebLogic Server in the cluster listens on a unique ip address/port combination. In production
situations you may have each WebLogic Server hosted on a different machine. You could also combine this with multi-homed machines. A
multi-homed machine has several ip addresses mapped to it, and therefore can run a WebLogic Server on each ip address. In the
cluster we set up here, we will take advantage of a great new feature in WebLogic Server 7.0: setting up multiple servers on one ip address.
All that is needed is that each Server in the cluster listens on it own unique port. This makes experimenting and developing with clusters
easy. There is no need to install WebLogic on various computers, or to configure your network to use multihoming. Of course, in production situations you will likely want to spread your servers over multiple machines, as this allows you to have no single point of
failure. We will also be taking advantage of the Configuration Wizard--another great feature in WebLogic Server 7.0 that makes
setting up a cluster easy.
*Please note the following conventions that are used throughout this document:
- The instructions given here, as well as with the examples themselves, are for Windows.
If you are using UNIX or Linux,
please substitute
/ for
\ in path names.
bea_home represents the central support
directory for all BEA products installed on one machine; for example, c:\bea.
WL_HOME represents the top-level installation directory for the entire WebLogic Platform.
The default path is c:\bea\weblogic700, however, you are not required to install this directory
under bea_home.
Creating a simple cluster
Here are the steps to creating a basic WebLogic cluster. You will be creating one Administration Server and two Managed Servers.
- Open the configuration wizard. On Windows you can open it from the
'Start' menu by going to BEA WebLogic Platform 7.0. There are also DOS and UNIX scripts that will start the Configuration
Wizard:
WL_HOME/common/bin/dmwiz.cmd
WL_HOME/common/bin/dmwiz.sh
- Use the WLS Domain template and select a domain name. Let's call this domain we are creating, "myClusterDomain".
Click 'Next.'
- Select 'Admin Server with Clustered Managed Servers' as your server type. Click 'Next.'
- Select a directory for your domain. Use the default provided, usually
bea_home\user_projects
- Configure your clustered servers. Click 'Add'. Call this first managed server 'ms1'. Enter the
ip address of your machine and choose a port number. Click 'Add'.
-
Click 'Add' again to set up a second server. Let's call this second one 'ms2'. Use the same ip address, but choose a different port number
than the one you used in the above step. Click 'Add' and then click 'Next'.
-
Next, configure your cluster. The defaults provided should be sufficient. You can always use the 'Previous' button to retrace your steps if you see
a mistake. If there are other users configuring WebLogic clusters,
you will want to contact your IT administrator to get a reserved multicast address and port and enter it here.
The clustered servers use this multicast address to broadcast heartbeats and do various server to server communication.
If someone on your network is using the same multicast address,
they may be sending their information to your servers! If that is the case, your cluster will not function.
- Click 'Next' and in the next screen,
choose your Administration Server name; let's call it 'Admin1'.
Fill in the appropriate ip address for your machine (this should be the same ip address that the two managed servers use)
and choose a port number for you new Administration Server. This port number must be different from both the port numbers used by the two managed
servers. Click 'Next'.
- Create a username and password. This will be used on server startup and to log in to the Administration Console. Click 'Next.'
- On the next screen, 'Install Servers as Windows Service,' make sure 'No' is highlighted. Click 'Next.'
- Select 'yes' on the next screen if you like to start WebLogic from the Windows Start menu. If not, select 'no.' Click 'Next.'
- This screen allows you to review all the information you previously entered. Make sure that the Administration server and two managed
servers share the ip addres of your machine. Also make sure that each is running on a different listen port. You can click on the
'Previous' button to backtrack and correct any mistakes you may have made. The following is an example of a correct configuration:
Domain Name: myClusterDomain
Server Type: Admin Server with Clustered Managed Server(s)
Domain Template Name: WLS Domain Template
Install Directory: C:\Bea\user_domains\AdminDomain
Listen Address: 127.0.0.1
Listen Port: 7001
SSL Listen Port: 7002
Windows Service: no
User Name: weblogic
Password: ********
CLUSTER INFORMATION:
Cluster Name: mycluster
Cluster Address: 127.0.0.1:7011,127.0.0.1:7021
Multicast Port: 7777
Multicast Address: 237.0.0.1
CLUSTER SERVERS INFORMATION:
Server Name Listen Address Listen Port
ms1 127.0.0.1 7011
ms2 127.0.0.1 7021
- Once you have reviewed your new cluster configuration, click 'Create' and then close the configuration wizard.
-
Now you can boot your new servers. Start the Administration Server by going to your
bea_home/user_domains/myClusterDomain. Type:
startweblogic
- Open a new command shell and go to the
bea_home/user_domains/myClusterDomain directory. The syntax for starting a managed server is,
startmanagedweblogic <managed server name> <ip_address:port of Administration Server>. So in this case you will start the first
managed server with the following command:
startmanagedweblogic ms1 127.0.0.1:7001
- Open another command shell to start your second managed server. Type:
startmanagedweblogic ms2 127.0.0.1:7001
- Your cluster is now up and running!
