Hi,
I'm using WebLogic 9.2.2. I'm trying to write a script to automatically set up my server and its cluster. But I can't figure out how to set the path to the source of the deployable
unit -- e.g. where my WAR file will go.
Below is the script I'm currently using, if that gives any insight into how I'm thinking. Thanks, - Dave
===========================Begin script====================================
from java.util import *
from javax.management import *
import javax.management.Attribute
print 'starting the script .... '
connect('user','password','t3://my-machine:17001')
cluster_name = 'Dave_Cluster'
ms1 = {'managed1': (7019,8020),'managed2': (7020,8021)}
machine = 'my-machine-machine'
log_file = 'logs/npsconfiggui-ms-1.log'
classpath = '/export/third-party/etsbea/application_conf/wls_9.2.2/nps_config_gui_conf:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/server/lib/weblogic.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/p13n/p13n-schemas.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/p13n/p13n_common.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/p13n/p13n_user.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/wlp/net uix_common.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/wlp/netuix_schemas.jar:/export/third-party/etsbea/product/wls_9.2.2/weblogic92/platform/lib/wlp/netuix_user.jar:.:/export/third-party/etsbea/product/wls_9.2.2/jdk1.5.0_12/lib/tools.jar'
arguments = '-Xms256m -Xmx256m -XX:NewSize=64m -XX:MaxNewSize=64m -XX:SurvivorRatio=4 -Dweblogic.wsee.useRequestHost=true'
edit()
startEdit()
print 'creating cluster '+cluster_name
clu = create(cluster_name,'Cluster')
cd('Clusters/' + cluster_name)
set('MulticastAddress', '237.0.0.11')
set('ClusterAddress', '147.191.71.90:7020')
set('MulticastPort', 9020)
set('DefaultLoadAlgorithm', 'round-robin-affinity')
set('WeblogicPluginEnabled', 'false')
cd('..\..')
for m, (lp, ssl_lp) in ms1.items():
cd ('/')
managedServer = create(m,'Server')
print 'creating managed server '+m
managedServer.setListenPort(lp)
managedServer.setListenPortEnabled(0)
# Set SSL port
cd('Servers/' + m + '/SSL/' + m)
set ('Enabled', 'true')
set ('ListenPort', ssl_lp)
# create ServerStart
cd ('../../ServerStart/' + m)
set ('ClassPath', classpath)
set ('Arguments', arguments)
cd ('../../Log/' + m)
set ('FileName', log_file)
# assign server to machine
assign('Server', m, 'Machine', machine)
# assign server to cluster
managedServer.setCluster(clu)
============================End script====================================