For those who don't have English as their mother language, it can be surprising to discover that the word 'cluster' is actually a noun and a verb; it means a group of similar objects growing closely together (noun) and, also, congregating or being part of a group (verb). Of course, nowadays, the term is popular as computer clusters have become widespread.
Based on that, WebLogic Server cluster or clusters basically means that a group of servers will work together, running at the same time, toward some predefined architectural goals. Clusters can be created to cater to different needs of users, such as scalability, reliability, performance, load balancing, failover, and management. Note that WebLogic clusters can be defined by multiple machines and servers (Managed Servers) but they may also be seen as one single WebLogic Server for applications and clients.
Clustering is a key concept in application scalability and needs to be used in order to scale out (horizontally) by adding more machines to a system or scale up (vertically) by adding more servers or resources to the system. Today, with cloud computing, preparing your application to be scalable in both ways is mandatory and can be a successful factor in determining the number of users or requests your application can handle.
Thanks to the Java EE application server model, clustering is native to most of the Java EE and WebLogic components, for example:
Application developers must be aware that clustering will modify the behavior of the application at runtime and should design the application taking this into consideration. For example, accessing a file when you have only one server and one machine is something easy and simple to do with a Java EE application, but doing this on a clustered environment in a consistent manner may incur different techniques considering that you may need to access the same file or different files from different physical machines.
Also, it's a common mistake to think that by simply clustering an application, you may end up with higher performance. There are cases when applications can run slower on clustered environments due to the heavy exchange of data between nodes; this is an indication that a session is being used without proper considerations such as the size of the objects in the session, and its replication is causing a performance bottleneck.
Clustering an environment or an application requires a detailed analysis of multiple technologies, such as network topologies, sizing, security, application architecture, and so on. Take these into consideration for any real or production system. In this book, we're creating a development environment according to the demo application's needs, for example.
Now, assuming that the machine and Node Manager configurations are in place, follow these steps to create the cluster:
http://localhost:7001/console
.Clusters
table, click on New, and then select Cluster from the pop-up menu.ticketsCluster
in the Name field and leave all other values unchanged.ticketMS_A
localhost
8001
ticketMS_B
localhost
9001
After the last step, you should have the configuration shown in the following screenshot:
This concludes the cluster configuration. Now, let's start the servers.
Congratulations, you have successfully set up and started a WebLogic cluster. To accomplish the steps performed here, WebLogic's administration instance sends instructions to the Node Manager asking it to start the Managed Server instances and, among other details, to exchange some metadata stating that they belong to a specific cluster, ticketsCluster
.
Another way to accomplish the same outcome as in the previous section is by creating a dynamic cluster and two dynamic servers. This is a concept introduced in Version 12.1.2 of the product and is closely aligned to the Cloud Application Foundation (CAF) initiative. In a nutshell, it gives us a more flexible and quick way to create a WebLogic cluster by just defining the number of servers available. The servers can follow a server template and all other settings, such as listen addresses, ports, and machines are associated properly. This cluster can then shrink or increase the number of servers by just adjusting the maximum number of servers.
To illustrate how this works, let's see how to create and configure the components necessary to set up a dynamic cluster.
The steps described here are not necessary to configure the remaining components of this chapter; they're just to show how easy it is to create a dynamic cluster and servers.
Of course, if you didn't create the cluster and Managed Servers as outlined in the previous section, you can use the following sequence that is way simpler—just remember to adjust the port values accordingly.
ticketsCluster
in the Name field and then click on Next.2
, enter tickets-
as the prefix, and then click on Next.We covered three concepts associated with this feature by completing the dynamic cluster creation wizard:
Here are a few comments related to these concepts and the dynamic cluster wizard we just executed:
100
in the Number of Dynamic Servers field; they will be created, but nothing else will be done, so you can go back later and change this value to a more realistic one.Here's the list of servers, showing static and dynamic ones together:
If you start one of the dynamic servers and click on its name after it starts running, you will see that there are only two tabs available, Monitoring and Control, both closely related to the current state of the server; neither of them has configuration parameters, only informational values.
All configuration parameters that we can tweak on a standard server are attached to the server template used to create the dynamic cluster; the server doesn't have any proprietary values (other than name, port number, and such, which are controlled by the cluster, not the server itself). So, if you want to change anything, such as logging, debugging, protocols, keystores, and so on, you are supposed to do that on the server template. And this is great because all dynamic servers will be using the same values, making administration a breeze.
18.118.2.240