Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

WLST: How to set the path to my deployment?  RSS feed

Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 import *

print 'starting the script .... '

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'


print 'creating cluster '+cluster_name
clu = create(cluster_name,'Cluster')
cd('Clusters/' + cluster_name)
set('MulticastAddress', '')
set('ClusterAddress', '')
set('MulticastPort', 9020)
set('DefaultLoadAlgorithm', 'round-robin-affinity')
set('WeblogicPluginEnabled', 'false')


for m, (lp, ssl_lp) in ms1.items():
cd ('/')

managedServer = create(m,'Server')
print 'creating managed server '+m
# 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
============================End script====================================
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!