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 🙂

 

 

 

 

4 comments

  1. Hey,

    How the load banalancers are aware of these clusters? what kind of plugin configuration need for apache? How it is dynamically notified to load balancer?

    1. The operations of dynamic clusters are similar to the traditional cluster.

      The plugins automatically notifies the web server about the servers in the cluster as soon as they are dynamically added. However you would need to make the corresponding entries in the httpd.conf for the dynamic servers as well.


      WebLogicCluster w1s1.com:7001,w1s2.com:7001,w1s3.com:7001
      MatchExpression *.jsp
      MatchExpression *.xyz

      1. So we need to add dynamic server list in weblogic cluster? if they are only running when load is high how apache load balancing the requests?

        1. A dynamic cluster is any cluster that contains one or more dynamic servers. Dynamic clusters are based on a single, shared server template. You use the shared server template to specify the configuration of the servers in your dynamic cluster so that each server does not need to be manually configured when expanding the cluster.

          Dynamic clusters enable you to easily increase the number of server instances in your domain. When configuring your dynamic cluster, you can specify the number of server instances you anticipate needing at peak load. WebLogic Server will create the specified number of server instances and apply the calculated attribute values to each one. When you need additional server capacity, you can then start a server instance without having to first manually configure the server instance and add it to the cluster.

          You can define the cluster members in the apache configuration file before hand and whenever the dynamic servers are started during peak load, they are eligible for processing the incoming load.

          Cheers,
          Anandraj

Leave a Reply