WebLogic:使用wlst创建dynamic cluster

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()




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值