Due to a lot of questions about that, I'll blog about the methodology to create
a simple domain, with a cluster distributed on several machines.
Architecture Schema
Usually, a best practice is to keep the admin server away from managed servers.
Because, if a strong load happens and overloads a managed server, it will consume all the resources available
on the machine, including those needed for the admin server to be safe & running.
Then consider we have three machines, one admin server and four managed servers :
Install the binaries
This part is the easiest one. On each machine, you'll have to install the binaries.
I strongly recommend that you use the silent mode, which is faster and requires no manual intervention.
http://e-docs.bea.com/common/docs100/install/silent.html
Another advice : it may sound obvious, but you have to use the same WLS version on every machine ...
Create the domain
You've got two possibilities for a domain creation :
Using the Config Wizard
This tool allows you to simply create a domain, by answering the asked questions, through a GUI or a command line.
It's based on the default WebLogic template, which is almost empty :)
(you may later base your domain on your own template, but that's another topic).
Using WLST
Using WLST, the concept is the same, you will base your domain on the default WLS template and
then, you'll script the instructions to create your domain.
Note : you may also use WLST with WLS 7 & 8
Unfortunately, this tool was hosted on projects Dev2Dev, which is not available anymore.
If you're interested in getting it, I may send it to you through email (about 2 539k).
Populate the domain
When you create a domain, as explained above, it will automatically create an administration server but
nothing else, unless you specify it. You can do so, either during the creation process, by chosing to
customize instead of selecting default, or by creating a light domain, launching the admin server,
and then creating all the wanted resources.
No matter what is the solution you've taken, you'll need to configure at least two kind of resources :
- Machines (which only are a logical representation of your physical machines)
- Managed Servers, which represent the JVM hosting your business logic.
It is mandatory that you define machines if you're willing to use the NodeManager. Else, even if you
don't want to use it, it's a good practice to define your machines. Will help you, when administrating
your domain, to see where your managed servers are hosted.
Then, once you've done those two steps, you may proceed to optional next steps (configuring datasources ...)
Distribute your domain
Now your domain is full and complete, we need to duplicate it on other machines.
Pack & Unpack commands
These commands were designed to package a domain and unpackage it on another machine.
You could do the same by using a zip or a tar.gz, but using these commands will ensure you that
you have taken only the necessary files for your domain to work (no log files and unnecessary stuff).
http://download.oracle.com/docs/cd/E12840_01/common/docs103/pack/commands.html
Pack / Unpack (WLST version)
You can also do that task by using WLST.
Here is the pack script (taken from the WLST project page on dev2dev) :
# pack.py: convert from pack command to wlst script
# This script shows how to convert form the pack command to a wlst script.
# Note that the domain and template settings must be single-quoted.# Read in the domain that you want to templatize
readDomain(<domain>)# Create a template from the domain
writeTemplate(<template>)closeDomain()
And here comes the unpack script :
# unpack.py: convert from unpack command to wlst script
# This script shows how to convert from the unpack command to a wlst script.
# Note that the domain and template values, and the options to setOption, must be single-quoted# Specify the template that you want to use
readTemplate('c:\wls9\user_templates\wlst_wls_template.jar')# If you specified the -username and -password option in the unpack command,
# Specify them here. Otherwise, delete these lines`
# Note that the domain_name field here is just the name of the domain, not the full path as specified in writeDomain below
cd ('/Security/<domain-name>')
create (<user_name>,'User')
cd ('User/<user_name>')
set ('Password',<password>)# analogous to unpack -java_home
setOption('JavaHome',<java_home>)# analogous to unpack -server_start_mode
setOption('ServerStartMode',<server_start_mode>)# analogous to unpack -app_dir
setOption('AppDir',<app_dir>)# write the domain
writeDomain(<domain>)closeTemplate()
By the way, I was talking about the fact you can zip your domain and install it elsewhere : that possibility should be considered as an
excellent way of saving snapshots of your domain (for instance, before installing a new resource ...).
If something should go wrong, you would simply have to delete your domain and unzip your backup to start as it was before.
NodeManager (optional)
The NodeManager is a tool that allows you several things, but the most important that come to my mind are :
- => to start servers from the console
- => to automatically restart a failed managed server
- => to migrate pinned services (JTA / JMS)
But some cilents don't want to use it because they prefer to use scripts. If this is your case, well, you're done.
Just start your managed servers on each machine and your cluster is up and running.
Else, read carefully the following lines !
For a domain to be managed by the NodeManager, you will have to enroll it first.
That means that you've got to help the NodeManager to be aware that a new domain was created.
(this step is NOT necessary when you're using the config wizard)
To see if the different nodemanagers are reachable, check the machines.
In case of a problem, you may see :
Of course, ideally, the status should be "Running".
Start your servers
If you chose to use the NodeManager, you only have to go on the administration console, and start your cluster.
Or you may start your managed servers using the start scripts. But be aware that with this solution, since your domain
has been duplicated on each machine, you could start all the servers on each machine. It's up to you to start only the relevant
servers on each machine.