You are on page 1of 29

Clusters Overview, Creation, and

Configuration

Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Objectives

After completing this lesson, you should be able to:


Describe two cluster architectures: basic and multi-tier
Create and configure a cluster
Create and configure a dynamic cluster

12 - 2 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Cluster: Review

A cluster:
Domain
Is a logical group of managed servers
Cluster
from the same domain that run Clients
cooperatively Server
Supports features that provide high Machine
availability for web applications, web
services, EJBs, and JMS Cluster
Server
Is transparent to its clients Proxy
Machine
Can have servers added to it statically or
dynamically
Server
Requires a cluster proxy to provide load
balancing, if it hosts web applications Machine

12 - 3 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Benefits of Clustering

Concept Description

More capacity for applications can be provided by


Scalability adding servers, without interruption of service or making
architectural changes.
Work (for example, client requests) is distributed across
Load balancing
the members of a cluster.
When a server fails, another one can automatically take
Failover its place. Information on the failed server is replicated
(or stored), so that the new server has access to it.
When a server fails, its pinned services can continue
Migration by moving them to another server in the cluster, or by
moving the entire failed server to a new hardware.

A pinned service is a service that must run only on a


single instance of WebLogic Server at any given time.

12 - 5 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Basic (Single-Tier) Cluster Architecture

Machine
Cluster
Server 1
Web App EJB
Code Code

Server 2
Web App EJB
Code Code
Cluster
Proxy
Server 3
Clients Web App EJB
Code Code Back-end
Systems
Server 4 and
Web App EJB Databases
Code Code
Firewall

Machine

12 - 6 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Multi-Tier Cluster Architecture

Machine
Cluster A
Server 1
Web App Machine
Code
Cluster B
Server 2 Server 5
Web App EJB
Code Code
Cluster
Proxy
Server 3 Server 6
Clients Web App EJB
Code Code Back-end
Systems
Server 4 and
Machine Databases
Web App
Code
Firewall

Machine

12 - 7 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Architecture Advantages and Disadvantages

Cluster
Architecture Advantages Disadvantages
Basic Easier to administer Cannot load balance
(single-tier) Less network traffic EJB calls
EJB calls are local (and therefore
faster)

Multi-tier EJB calls are load balanced Harder to administer


Scaling options (for example, you Perhaps more
can shift (or add) hardware and hardware and licensing
WebLogic server instances to costs
whichever tier is busier) EJB calls are remote
More security options (for example, (and therefore slower)
you could place a firewall in More network traffic
between the web application tier
and the EJB tier)

12 - 8 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Cluster Communication

Cluster members communicate with each other in two


ways:
One-to-many messages:
For periodic heartbeats to indicate continued availability
To announce the availability of clustered services
Note: This communication can use either:
IP unicast: No additional configuration is required.
IP multicast: A multicast host and port must be configured.
Peer-to-peer messages:
For replicating HTTP session and stateful session EJB state
To access clustered objects that reside on a remote server
(multi-tier architecture)
Note: This communication uses sockets.

12 - 10 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Creating a Cluster:
Configuration Wizard
In the Configuration Wizard:
1. Add clusters.
2. Assign managed servers to them.

12 - 12 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Creating a Cluster:
Administration Console

2
3

12 - 13 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Adding Servers to the Cluster:
Administration Console

2 3

12 - 14 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Server Templates and Dynamic Clusters

A dynamic cluster is based on a server template.

Server Template A
Defines common
server attributes

Assigned to

Dynamic Cluster Number of


Dynamic Servers = 3
Servers
based on ServerA-1 ServerA-2 ServerA-3
the
template
are
generated.
Machine1 Machine2 Machine3

12 - 15 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Server Templates and Dynamic Clusters

A server template defines server attributes.


Servers based on that template share those attributes.
If you change an attribute in the template, all of the servers
based on that template change.
A cluster can be associated with one server template. The
cluster sets the number of dynamic servers needed.
That number of servers is generated and assigned to the
cluster.
These servers show in the Servers table with the Type
Dynamic (as opposed to Configured).
Attributes of dynamic servers that are server-specific are
calculated when the servers are generated (for example, the
server names).

12 - 16 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Creating a Dynamic Cluster

2
3

12 - 17 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Creating a Dynamic Cluster

5 6

Use machines that have a name that


starts with the string machine

12 - 18 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Creating a Dynamic Cluster

7 8

The first server port numbers 9


will actually be these plus 1.

10

New generated servers

12 - 20 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Editing the New Dynamic Cluster

12 - 21 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Editing the New Server Template

12 - 22 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Dynamic Server Calculated Attributes

Dynamic servers are generated for a dynamic cluster based on


the server template. Server-specific attributes are calculated:
Server name: The Server Name Prefix followed by indexes
in order, starting with 1.
Cluster has Enable Calculated Listen Ports selected
Listen ports:
Dynamic: The port values entered in the template +1 for the
first server, +2 for the second, and so on.
Static: Each server gets the same template port values
Machine names: Cluster has Enable Calculated Machine Associations selected

No machine name match expression: All machines are


rotated through as the servers are generated.
Machine name match expression: Only matching machines
are rotated through as the servers are generated.

12 - 23 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Dynamic Server Calculated Attributes: Example

Server Template Not used


Port Enabled:
Listen Port: 8999 machine1

Assigned to machine2

Dynamic Cluster
Maximum Number of Servers: 3
Server Name Prefix: serv-
Enable Calculated Listen Ports:
Enable Calculated Machine Associations:
Machine Name Match Expression: fast*

serv-1 serv-2 serv-3


Listen Port: 9000 Listen Port: 9001 Listen Port: 9002

fastmachineA fastmachineB fastmachineC

12 - 25 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Comparing Configured and Dynamic Clusters

Feature Configured Dynamic


Cluster Cluster
Create with the Admin Console / WLST Yes Yes

Create with the Configuration Wizard Yes No

Edit individual server attributes Yes No

Servers generated automatically No Yes

Can contain configured servers Yes Yes

Can contain dynamic servers No Yes

Supports service-level migration Yes No

Supports whole-server migration Yes Yes

12 - 26 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Creating a Server Template

You can create a server template independently from creating


a dynamic cluster:

1
4
This template
can be cloned
when creating
a dynamic
cluster, or
assigned to a
2
cluster to
make it
dynamic.

12 - 27 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Creating a Server Template

7
6
5

Choose
other tabs
and edit 8
server
attributes

12 - 28 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Server Templates and Configured Servers

In addition to using server templates to define the servers in a


dynamic cluster, a server template can be assigned to any
number of configured servers, so those servers can share
common, nondefault attributes.
The attributes can be overridden by the individual servers.

12 - 29 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Quiz

The multi-tier cluster architecture allows you to load balance


EJB calls. But, the basic (single-tier) architecture has an
EJB-related advantage over multi-tier. The advantage is:
a. It cannot use EJBs, which makes development simpler
b. This is a trick question, because the single-tier architecture
has no EJB-related advantages
c. All EJB calls are local and, therefore, faster

12 - 30 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Quiz

A dynamic cluster is based on:


a. One server template
b. Multiple server templates
c. A cluster proxy
d. A domain template

12 - 31 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Summary

In this lesson, you should have learned how to:


Describe two cluster architectures: basic and multi-tier
Create and configure a cluster
Create and configure a dynamic cluster

12 - 32 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Practice 12-1 Overview:
Configuring a Cluster
This practice covers creating a cluster by using the
administration console.

12 - 33 Copyright 2014, Oracle and/or its affiliates. All rights reserved.


Practice 12-2 Overview:
Configuring a Dynamic Cluster
This practice covers creating a dynamic cluster by using the
administration console.

12 - 34 Copyright 2014, Oracle and/or its affiliates. All rights reserved.