2009-04-27

How to create a distributed WebLogic domain ?

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 :

 

image

 

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).

 

 

image

 

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 :

  1. Machines (which only are a logical representation of your physical machines)
  2. 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 :

 

image

 

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.

 

image

 

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.

 

 

9 comments:

Andreas Koop said...

Hello Maxence,

thanks for your great article. But there is one thing I am missing. I ran in trouble with SSL/Hostname verification when setting it up like that using Node Manager. It should be noted that Hostname verfification should be set to None on all Server configurations if using Demo certificates.

Another thing i am confusing about is that if you populate a domain on the other machines, there is always the admin server on each machine isn't it? But there should be exactly one admin server per domain. So that is a bit confusing....Maybe you can clarify this a bit more.

Thanks+Greets,
Andreas.

Dharsh said...

Hi Andreas,

If you use pack / unpack commands, it will just create the files necessary to manage the new server on the new machine and get some admin server info to manage the domain. Otherwise it wont create a new admin server on each machine.
Cheers
Sud

Maxence Button said...

Hi Andreas,

Sorry for the late reply.

Yep, I've already run into that problem (SSL/Hostname) before, I'll try to make a little note on that soon.

As for the presence of an admin server on each machine, I would advise you to test it by yourself : that way, you'll better understand how this replication process works.

Cheers

EasyV said...

Great Article, Thanks..

Do these instructions apply for 9.2
as well?

Also, in our case, I need to do a
cluster of 4 managed servers (2 on
each machine). I'm assuming these
steps works for this as well
as long as I configure the cluster
on the graphical domain setup?

Thanks
easyV

Anonymous said...

How to change DeploymentOrder of the application via wlst orprogramatically ?

Dave said...

Hi,

I have installed weblogic server 10.3.2 on 3 different machines. On machine 1 i only have WLS and have created a domain that contains all the information of the managed servers ports and IP addresses running on the other 2 machines (for machine 2 - soa_server1 and bam_server1 and for machine 3 wls_services, wls_portlet and wls_spaces).

I have packed the domain and unpacked it on machine 2 and 3 then extended the domain to add the application resources for soa suite and web center.

I start the admin server on machine 1 and then run the managed server on machine 2 (for soa and bam) by running the startManagedWebLogic.cmd soa_server1 http://1.1.1.1:7001; i type in the admin user and password and can see running status for both servers. when logging into the admin console both servers are running withe web center servers with the status 'shutdown' (obviously cause i have not started them on machine 3).

The problem is when i am trying to access the soa suite url's i.e. /em or port 8001/ integration/worklistapp or.....:9001/OracleBAM i am getting http 404 errors?

Just to test: i created another domain on machine 2 that contains the admin server, soa and bam servers and run them from the same machine and i was able to access enterprise manager, BAM, BPM worklist etc.....

Any ideas?

Thanks

Dhrub said...

In my work profile I need create domain for all Pre-Prod (Dev, QA, SIT, UAT) and Prod (Prod Live, DR) environments. Now all of the configurations are same on all those domains except some naming change like instance name, machine name or DS/JMS server name.

Now, is there any way where I can create a domain once and run the template of that domain whenever necessary with naming changes in stead of doing the same wok again and again.

I have tried the WLST configToScript option, but that needs a lot manual change on the config.py file and also need a good understanding of WLST which is not possible for everyone.

So, please guide me with some other option.

jaswn said...

Hi,

I am new to weblogic and seek your advice. We have a domain in prod and we want to create the same environment in BCP. So i copied the existing domain folder on BCP server, which is a different machine. Now when iam starting it, it shows these errors
<>
<>

<> .
i tried to resolve the issue by vreating boot.properties file, then deleting ldap but it didnt work.

So my stupid question is do i need to install weblogic on BCP server or the copied tarball of domain is good enough to run the domain on BCP server?
Or is there anyway to figure out whether weblogic is installed on a machine or not?

Please reply

Thank you,
Jai

madhava said...

very good article.

I have following senario where i have to create multiple Doamins based on the Transaction valume. i have 128 gb Ram of 3 Spark mechines are avalble .
can you sugest how do i go about creating the doamins and Managed server. i have to serve 800 TPS Totally.

what are the best practicess for Domain creation. what factors do i have to keep in mind while doing the same.
thanks