Dynamic Cluster Archive

Weblogic Dynamic Cluster configuration

This is a new feature available in Weblogic 12c (12.1.2).

Dynamic cluster contains one or more dynamic servers. It allows you to add a new server dynamically at peak loads.  This would eliminate the need of adding the managed server manually to a cluster.  The businesses can define number of servers that needs to be added dynamically anticipating the peak loads.

The concept of dynamic cluster is based on a single shared server template.

For further reading on server template please refer the below post.

Prerequisites:

  1. Configured machine .

 

You can create the setup in two ways.

  1. From Administration console
  2. Using WLST

 

I. Using Administration console:

1. Login into the administration console  — >  Cluster  — > Click on new — > Select Dynamic Cluster from the drop down.

 

Weblogic Dynamic Cluster

Weblogic Dynamic Cluster

 

2. Select the messaging mode and define number of servers you would need at the peak load.

You can either create a new server template or use an already existing one.

Dynamic Cluster-NoOfServers

Dynamic Cluster-NoOfServers

 

 

3. Associate dynamic servers with machines.

Note: Associating dynamic servers with machines is essential if you intend to use the Node Manager and the Administration Console (or WLST) to start servers.

 

Weblogic Dynamic Cluster-Machine

Weblogic Dynamic Cluster-Machine

 

 

4. Specify Listen port bindings:

You would need to define port bindings for only one dynamic server, and each subsequent server will be given an incremental port.

Weblogic Dynamic Cluster

Weblogic Dynamic Cluster

weblogic Dynamic Cluster

weblogic Dynamic Cluster

 

Weblogic Dynamic Cluster Details

Weblogic Dynamic Cluster Details

 

This would create a server template based on the dynamic cluster configuration, which can be reused.

Dynamic Cluster Server Template

Dynamic Cluster Server Template

 

 

 

II . Using WLST:

You can use the below WLST to create a dynamic cluster.

# 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 dynamic servers.
#

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

 

 

Further  reading:

http://docs.oracle.com/middleware/1212/wls/CLUST/dynamic_clusters.htm#CLUST678

Cheers,

Wonders Team 🙂