WebLogic Domain Creation procedures
Hey all, here we are going to know about the three ways to create a WebLogic Domain. Provided you must have WebLogic installed on your machine. In this article I'm using two different operating systems: Windows, Precise Ubuntu Linux. Most interesting thing here is multiple alternative ways. If one possibility is not working out you can try out with other option. Usually GUI mode domain creation is pretty simple but it need XWindows support in Llinux so it is applicable in the Windows environment. The precise Ubuntu which is plain vanilla Linux server for fare enough configuration on Linux platform. In such cases WLST would be perfect choice.3 Ways to create to create Domain are:
☺
- Configuration Wizard
- Using Pack & UNPack
- WLST
- Using Configuration Wizard for WebLogic Domain The Configuration Wizard simplifies the process of creating or extending a domain. To create or extend a domain using the Configuration Wizard, you simply select the product components you want to include in your domain (or choose a template that best meets your requirements), and provide some basic configuration information. The Configuration Wizard then creates or extends the domain using the settings from the templates that contain the component functionality you specified Installation steps
- Using pack and unpack command The WebLogic provides this pack and unpack commands for two phase usage one is compressing the WebLogic Domain and on the other side (remote machine) uncompressed the domain. This feature can be used for various purposes
- Backup of domains
- Remote managed server configuration
- Reusing Domain template for creating new environments
- Using WLST Script
Step 1: Invoking Configuration Wizard from command prompt.
cd $WL_HOME/common/bin config.sh
Now, in Windows environment
cd %WL_HOME%\common\bin config.cmd
Step 2: Configuration Welcome screen !!
Steop 3: Configuration Type existing or fresh domain creation?
Step 4: Creating Domain using Product Template selects all templates by default, Actually this selection would be useful when we create a domain from custom domain template or specific business purpose we can use SOA, AIA, OSB etc type of extra templates.
Step 5: Enter the Admin configuration details
Step 6: In this windows of Domain Mode we have two options Development Mode & Production Mode based on your need select one among them I took Production mode here & select JDK
Step 7: Advanced Configuration you have three options here Administration Server, Node Manager & Manager Servers, Clusters & Coherence, But my domain I selected only Administration Server.
Step 8: Admin Server IP Address, Port number if you need you can select SSL Port. For me, not selecting.
Step 9: Configuration Summary this is where you can review and if there is anything you wish to modify you can choose back and update them.
Step 10: Configuration Progress
Step 11: Configuration Success this confirms us everything went well!
Select your choice!
Using Pack command
Let me share my experiment here, I already created domain called Citydomain , our mission is running this domain in windows Machine first we need compress this Exiting Ctitydomain using pack command then we need to move or copy this jar file into shared folder then in windows machine we will run Unpack command in windows :pack.sh -domain=/home/vagrant/wlsdomains/Citydomain \ -template="/home/vagrant/wlsdomains/Citydomain.jar" -template_name="Citydomain.jar"Here I am using Citydomain as example I already created this domain using WLST Scripting this domain had save under home/vagrant/wlsdomains/Citydomain in following path here if you are using multiple lines we need to use \ (backward slash) at end if you want we can run this command in single line too at that time we need to remove this backward slash. Next line 2 -template="/home/vagrant/wlsdomains/Citydomain.jar" -template_name="Citydomain.jar" Here we are creating template Jar file of a WebLogic domain name - Citydomain and naming this Jar file as Citydomain.jar which is our outcome.
Unpack Command
cp /home/vagrant/wlsdomains/Citydomain.jar /vagrant_dataWe will run this Unpack command in windows for this first we need to copy this Citydomain.jar into shared folder(OFMW) this folder then we can un compress this Citydomain.jar using Unpack.cmd then that would create domain in windows machine
unpack.cmd -template= E:/OFMW/Citydomain.jar -domain=E:/wlsdomains/CitydomainFirst
Lets see the syntax ...
Now lets run the unpack command ...
WLST scripting is one of other way we can create new WebLogic domain in Windows or Linux platform. Here we are using simple python code in this script.
########################################################### # This script will dynamically create the domain as per your inputs ########################################################### import os WLHOME=os.environ['WL_HOME'] #========================================== # Create a domain from the weblogic domain template. #========================================== readTemplate(WLHOME+'/common/templates/wls/wls.jar') cd('Servers/AdminServer') AdminName=raw_input('Please Enter Admin ServerName: ') set('Name',AdminName) #========================================== # Configure the Administration Server #========================================== AdminListenAdr=raw_input('Please Enter Admin Listen Address: ') AdminListenPort=input('Please enter Admin listen Port: ') set('ListenAddress',AdminListenAdr) set('ListenPort', AdminListenPort) #==================================================== # Define the password for user weblogic. You must define the password before you # can write the domain. #==================================================== cd('/') cd('Security/base_domain/User/weblogic') usr=raw_input('Please Enter AdminUser Name: ') set('Name',usr) AdminPassword=raw_input('Please enter Admin password:') cmo.setPassword(AdminPassword) # - OverwriteDomain: Overwrites domain, when saving, if one exists. setOption('OverwriteDomain', 'true') #============================================== # Write the domain, close template and finally exit from the WLST #============================================== domainPath=raw_input('Enter the domain path: ') domainName=raw_input('Enter domain name: ') print 'Given domain path, name : ', domainPath, domainName writeDomain(domainPath+"/"+domainName) closeTemplate() exit()
Above script is example for creating Domain using WLST Scripting we can copy this script use VI Editor to make new file & name the script
Here we are naming our script as
We had used Interactive scripting here we need to enter details like Admin Server name, Listen Address Port number, Admin user Name, Admin Password & specify he path we were we need to create domain & finally domain name it take 10 to 15 minutes to create domain