domain.name="dynamicLoadBalancerDomain"
cluster.name="dyn-cltr"
adminServer.name="adminServer"
adminServer.usr="admin"
adminServer.pwd="12345678"
adminServer.address="127.0.0.1"
adminServer.port="7081"
nodeMgr.usr="admin"
nodeMgr.pwd="12345678"
nodeMgr.port="5083"
domain.dir="C:/user_domains/${domain.name}"
# create dynamic cluster
try:
readDomain('${domain.dir}')
create('m1', 'Machine')
create('m2', 'Machine')
create('m3', 'Machine')
cd('/Machine/m1')
create('m1', 'NodeManager')
cd('/Machine/m1/NodeManager/m1')
set('ListenAddress','${adminServer.address}')
set('ListenPort',${nodeMgr.port})
set('NMType','SSL')
cd('/Machine/m2')
create('m2', 'NodeManager')
cd('/Machine/m2/NodeManager/m2')
set('ListenAddress','${adminServer.address}')
set('ListenPort',${nodeMgr.port})
set('NMType','SSL')
cd('/Machine/m3')
create('m3', 'NodeManager')
cd('/Machine/m3/NodeManager/m3')
set('ListenAddress','${adminServer.address}')
set('ListenPort',${nodeMgr.port})
set('NMType','SSL')
cd('/')
dst=create('dyn-cltr-svr-tpl', 'ServerTemplate')
cd('/ServerTemplate/dyn-cltr-svr-tpl')
set('AcceptBacklog',2000)
set('AutoRestart','true')
set('RestartMax',10)
set('StartupTimeout',600)
cd('/')
dyncltr=create('${cluster.name}', 'Cluster')
cd('/Cluster/${cluster.name}')
set('MigrationBasis','consensus')
set('CandidateMachinesForMigratableServers','m1,m2,m3')
dynServers=create('${cluster.name}','DynamicServers')
cd('/Cluster/${cluster.name}/DynamicServers/${cluster.name}')
set('ServerNamePrefix','dyn-svr-')
set('MaximumDynamicServerCount',3)
set('CalculatedMachineNames','true')
set('MachineNameMatchExpression','m*')
set('ServerTemplate','dyn-cltr-svr-tpl')
updateDomain()
closeDomain()
except Exception,e:
dumpStack()
# start dynamic cluster
try:
connect('${adminServer.usr}','${adminServer.pwd}','t3://${adminServer.address}:${adminServer.port}')
startNodeManager(verbose='true', NodeManagerHome='${domain.dir}/nodemanager')
# start('dyn-svr-1','Server')
# start('dyn-svr-2','Server')
# start('dyn-svr-3','Server')
start('${cluster.name}','Cluster')
state('${cluster.name}','Cluster')
disconnect()
except:
dumpStack()
# shutdown dynamic cluster
try:
connect('${adminServer.usr}','${adminServer.pwd}','t3://${adminServer.address}:${adminServer.port}')
shutdown('${cluster.name}','Cluster')
state('${cluster.name}','Cluster')
disconnect()
nmConnect('${adminServer.usr}', '${adminServer.pwd}', '${adminServer.address}', '${nodeMgr.port}', '${domain.name}', '${domain.dir}', 'SSL', 'true')
stopNodeManager()
except:
dumpStack()
WebLogic:使用wlst创建dynamic cluster
于 2014-08-28 17:19:40 首次发布