开发者

Anyone tried Cluster automation with WLST?

Most of the production env might need a automation script for Clusters. Reason is whenever th开发者_高级运维ere is a need of enhance the sites need to add new cluster to existing domain. When there is a decommissioned a physical site that needs removal of cluster from the domain. There is also possibility of "Growth" of Cluster (adding managed servers to a cluster). Finally there is also need of decommission of machines which requires removal of servers from the cluster. Menu 1. Add a Cluster 2. Del a Cluster 3. Add a server to Cluster 4. Del a server from Cluster

Please share your thoughts and suggestions...

Thanks in advance.


I'm actually doing exactly that and it works fine.

You'll have to add the inital

edit()
startEdit()

and to save

save()
activate(block='true')

as well as exception handling but the functions are pretty simple:

Add a server to cluster:

managedServer = create(ServerName,'Server')
managedServer.setListenPort(ListenPort)
managedServer.setCluster(Clustername)
managedServer.setMachine(Machinename)

Delete server from cluster (and the server, optional):

serverMBean = getMBean("Servers/"+ServerName)
serverMBean.setCluster(None)
serverMBean.setMachine(None)
delete(ServerName,'Server')

Add a cluster (you can also use the same method as creating a server -> create(name, 'Cluster'):

cd('/')
cmo.createCluster('Cluster-0')
cd('/Clusters/Cluster-0')
cmo.setClusterMessagingMode('unicast')
...

Delete a cluster works the same way as deleting a server, you should power them down first though.

In general you can use the admin console to perform the desired actions and the record button at the top allows you to generate a wlst script which does exactly what you do in the admin console.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜