Managing Oracle Weblogic with WLST - Creating a cluster with WLST

 

Creating a cluster with WLST

We will complete the WLST section by providing a ready-to-cook recipe for creating a cluster made up of three Managed Servers (serverA, serverB, serverC). The script is self-descriptive and it uses the createCluster command on the root of the MBean hierarchy in order to create the Cluster which will be later assigned to the Managed Servers via the setCluster command:

connect('myuser','mypass','myhost:7001')

edit()

startEdit()

cd('/')

cmo.createCluster('SampleCluster')

cd('/Clusters/HRWebCluster')

cluster = getMBean('/Clusters/SampleCluster')

cd('/Servers/serverA')

cmo.setCluster(cluster)

cd('/Servers/serverB')

cmo.setCluster(cluster)

cd('/Servers/serverC')

cmo.setCluster(cluster)

activate()

disconnect()

exit()

Francesco Google+