Followers

Tuesday, January 28, 2014

WLST script for Dynamic Cluster creation in weblgoic

# This example demonstrates the WLST commands needed to create a dynamic cluster#
(dynamic-cluster). The dynamic cluster utilizes a server template
# dynamic-cluster-server-template. To keep this example simple, error handling# was omitted.#
connect()
edit()
startEdit()
## Create the server template for the dynamic servers and set the attributes for# the dynamic servers. Setting the cluster is not required.#
dynamicServerTemplate=cmo.createServerTemplate("dynamic-cluster-server-template")
dynamicServerTemplate.setAcceptBacklog(2000)
dynamicServerTemplate.setAutoRestart(true)
dynamicServerTemplate.setRestartMax(10)
dynamicServerTemplate.setStartupTimeout(600)
## Create the dynamic cluster and set the dynamicservers.#
dynCluster=cmo.createCluster("dynamic-cluster")
dynServers=dynCluster.getDynamicServers()
dynServers.setMaximumDynamicServerCount(10)
dynServers.setServerTemplate(dynamicServerTemplate)
## Dynamic server names will be dynamic-server-1, dynamic-server-2, ...,# dynamic-server-10.#
dynServers.setServerNamePrefix("dynamic-server-")
## Listen ports and machines assignments will be calculated. Using a round-robin#
algorithm, servers will be assigned to machines with names that start with#dyn-machine.#
dynServers.setCalculatedMachineNames(true)dynServers.setMachineNameMatchExpression("dyn-machine*")
## activate the changes#
activate()

No comments:

Post a Comment