WLST SCRIPT:-
- # This is an Offline WLST script to create a WLS 12.1.3.0 (Oracle Weblogic Server 12c) Domain
- # Domain consists of:
- # 1. Admin Server
- # 2. Two Managed Servers
- # 3. A Cluster with Two Managed Server
- # 4. An application deployed to the cluster
- # Read a domain template
- print('ReadingTemplate - D:/Oracle/12cR1/one/wlserver_12.1.3/common/templates/domains/wls.jar')
- readTemplate('D:/Oracle/12cR1/one/wlserver_12.1.3/common/templates/domains/wls.jar')
- # Admin Server
- print('Creating Server - Admin Server')
- cd('Servers/AdminServer')
- set('ListenAddress','localhost')
- set('ListenPort', 7001)
- create('AdminServer','SSL')
- cd('SSL/AdminServer')
- set('Enabled', 'True')
- set('ListenPort', 7002)
- # Security
- print('Creating Password')
- cd('/')
- cd('Security/base_domain/User/weblogic')
- cmo.setPassword('welcome1')
- # Start Up
- print('Setting StartUp Options')
- setOption('CreateStartMenu', 'false')
- setOption('ServerStartMode', 'dev')
- setOption('JavaHome','D:/Oracle/11gR1/one/jrockit_170_75_R27.6.2-20')
- setOption('OverwriteDomain', 'true')
- # Create Domain to File System
- print('Writing Domain To File System')
- writeDomain('D:/Oracle/12cR1/one/user_projects/domains/OfflineDomain_WLST')
- closeTemplate()
- # Read the Created Domain
- print('Reading the Domain from In Offline Mode')
- readDomain('D:/Oracle/12cR1/one/user_projects/domains/OfflineDomain_WLST')
- # Creating Managed Servers
- print('Creating Server - MS1 on Port # 8001')
- cd('/')
- create('MS1', 'Server')
- cd('Server/MS1')
- set('ListenPort', 8001)
- set('ListenAddress', 'localhost')
- print('Creating Server - MS2 on Port # 8011')
- cd('/')
- create('MS2', 'Server')
- cd('Server/MS2')
- set('ListenPort', 8011)
- set('ListenAddress', 'localhost')
- # Create and configure a cluster and assign the Managed Servers to that cluster.
- print('Creating Cluster - WLSTCluster and adding MS1, MS2')
- cd('/')
- create('WLSTCluster', 'Cluster')
- assign('Server', 'MS1,MS2','Cluster','WLSTCluster')
- cd('Cluster/WLSTCluster')
- set('MulticastAddress', '237.0.0.101')
- set('MulticastPort', 8050)
- set('WeblogicPluginEnabled', 'true')
- #Create a new application deployment - Deployment Archive : "d:/Lou/VersionInfo.war"
- print('Deploying application named VersionInfo from d:\Lou\VersionInfo.war')
- cd('/')
- myApp=create('VersionInfo', 'AppDeployment')
- myApp.setSourcePath('d:/Lou/VersionInfo.war')
- assign('AppDeployment', 'VersionInfo', 'Target', 'WLSTCluster')
- # updating the changes
- print('Finalizing the changes')
- updateDomain()
- closeDomain()
- # Exiting
- print('Exiting...')
- exit()
- # Code written by:
- # Krushna Sunkara
---
No comments:
Post a Comment