JEUS Clustering

This chapter defines a cluster as a part of a domain and describes the composition of a cluster and its relationship to the domain. In addition, it describes how to create, configure, change, and delete a cluster.

1. Overview

A cluster is a group of servers that run the same services in order to support load balancing for scalability and failover for stability.

Performance can be improved because multiple servers share the load and dynamic load balancing can be performed by adding or deleting servers to the cluster. Even if some servers fail, the remaining servers continue to function, so users are not aware of the failures. A Cluster can easily handle large loads and provide uninterrupted services.

2. Relationship between Clusters and Domain

A domain is a group of servers or clusters that provide services. A cluster is a group of servers that provide the same services. A domain can have multiple clusters. Servers in a cluster can be on the same machine or different machines. It is recommend to use servers on different machines, so that if one machine fails the other servers on other machines can continue to provide the services.

A Master server manages a single domain. If there are multiple clusters in a domain, those clusters are managed by the same Master server.

figure cluster and domain
Relationship Between Clusters and Domain

3. Cluster Features

A cluster consists of MSs that run the same services in a domain. Clusters usually contain multiple machines and support the following functions.

  • Load balancing

    Load balancing distributes services across multiple servers to prevent a service from stopping due to excessive load and to improve the service response speed.

    An environment where same services can be executed must be configured, and each server must know the location and status of the other servers.

  • Failover

    If a server is shut down abnormally, another server takes over the services that the failed server was executing.

    The server that takes over the services must be able to execute the same services and monitor the failed server. The server should also know about the failed server’s service progress status.

To make this possible, it is recommended that all servers have the same applications deployed and registered on them and have the same resources. Servers in a cluster share the location and state of each server using multicast, and also share service progress in the event that a server fails. To improve resource efficiency, servers can be added to or removed from the cluster according to the load.

Some services cannot be clustered. The following are the services that can be clustered.

Service Description

Servlets/Jsps

Web engines support web application clustering using the web server and HTTP session clustering.

For detailed explanations about web application clustering by a web server, refer to Configuring Web Server Load Balancing, and for more information about HTTP serssion clustering, see Distributed Session Servers.

EJB

EJB engines support session beans, message-driven beans, entity beans, and timer service clustering. For more information about clustering in EJB engines, refer to EJB Clustering.

JMS

JMS supports connection factory, destination, and durable subscriber clustering. For detailed information about clustering in JMS, refer to JEUS MQ Clustering.

The following constraints should be considered when creating a cluster.

  • All the servers in a cluster must use the same version of JEUS.

  • Each server must belong to only one cluster.

  • Because resources cannot be shared across domains, all servers in a cluster must be in the same domain.

4. Creating a Cluster

When configuring a domain, create a cluster by considering the types and priorities of services. Refer to Adding a Cluster in Configuring a Domain for information about creating a cluster.

5. Cluster Settings

Cluster configurations can be divided into common server settings and cluster settings.

5.1. Common Server Settings

Common server settings allow all servers in a cluster to run the same services and are needed to create both clusters as well as individual servers.

Refer to JEUS Configuration for detailed information on common server settings.

5.2. Cluster Settings

The cluster settings are for load balancing, failover, configuring cluster communication, session servers, timer services, JMS resources, and for registering and deleting data sources.

If the configuration changes, restarting the entire cluster is recommended in case any of the settings requires a server restart.

  • Setting a session server cluster

    A distributed session server in a clustered environment can use both load balancing and failover.

    There is no configuration to disable a distributed session server. When servers are clustered, a distributed session server is automatically configured across the servers.

    Refer to Distributed Session Servers for detailed information about distributed session servers and Distributed Session Server Configuration in JEUS Session Guide for detailed description and configuration of each item.

  • Setting the cluster timer service

    This is used to set up a timer service in a clustered environment. Refer to EJB Timer Service for detailed information about setting up timer services.

  • Setting clustered JMS resources

    This is used to set up destination and durable subscriber in the cluster. Refer to Server Configuration for detailed information about setting up JMS resources.

  • Registering and deleting data sources

    Data sources that are registered in a cluster can be used by all servers in the cluster and the registration is performed dynamically. Deleting data sources that are registered in a cluster can also be performed dynamically. Data sources that are deleted from a cluster are not available to servers in the cluster.

    Refer to Dynamic Data Source Configuration for detailed information about using registered data sources and how to register and delete them.

6. Changing a Cluster

The number of servers in a cluster can be adjusted by adding or deleting servers based on the load.

6.1. Adding a Server to the Cluster

As the load increases, a cluster needs to scale by adding more servers. Adding a server with the same configuration as the existing servers is recommended because it will execute the same services.

This section describes how to add a server to the cluster.

Using the Console Tool

Servers can be added to the cluster using jeusadmin, a console tool.

The following are the steps for creating servers and adding them to a cluster.

  1. Create a server (server2) to add to the cluster by using the add-server command. Refer to add-server for detailed information about the add-server command.

    [MASTER]domain1.adminServer>add-server server2 -node node2 -addr 0.0.0.0 -port 9936
    Successfully performed the ADD operation for server (server2).
     NOTICE : base-addr [0.0.0.0] base-port [9936] http-port [8088]
    Check the results using "list-servers or add-server".
  2. Add server2 to the cluster (cluster1) by using the add-servers-to-cluster command.

    Refer to add-servers-to-cluster for detailed information about the add-servers-to-cluster command.

    [MASTER]domain1.adminServer>add-servers-to-cluster cluster1 -servers server2
    Successfully performed the ADD operation for The server list for cluster(cluster1)..
    Check the results using "list-clusters cluster1 or add-servers-to-cluster cluster1".
  3. Start the newly added server.

  4. Check that server1 and server2 are running properly in 'cluster1' by using the serverinfo command.

    [MASTER]domain1.adminServer>serverinfo
    Information about Domain (domain1)
    ================================================================================
    +-------+--------+-----+-----+-----+---------------+-------+-----------+-------+
    | Server| Status |Node | PID | Clu |  Latest Start |  Need |   Listen  | Runni |
    |       |        |Name |     |ster |    Time /     |  to   |   Ports   |  ng   |
    |       |        |     |     |     | Shutdown Time |Restart|           |Engines|
    +-------+--------+-----+-----+-----+---------------+-------+-----------+-------+
    | admin | RUNNIN | nod | 902 | N/A | 2022-07-19    | false | base-0.0. | jms,  |
    |Server |G(02:56 |e1   |88   |     |(Tue) PM       |       |0.0:9736   |web,   |
    | (*)   |:51)    |     |     |     |12:55:20 KST   |       | http-serv |ejb    |
    |       |        |     |     |     |               |       |er-0.0.0.0 |       |
    |       |        |     |     |     |               |       |:8088      |       |
    +-------+--------+-----+-----+-----+---------------+-------+-----------+-------+
    | serve | RUNNIN | nod | 100 | clu | 2022-07-19    | false | base-0.0. | jms,  |
    |r1     |G(00:00 |e1   |083  |ster1|(Tue) PM       |       |0.0:9836   |web,   |
    |       |:17)    |     |     |     |03:51:54 KST   |       | http-serv |ejb    |
    |       |        |     |     |     |               |       |er-0.0.0.0 |       |
    |       |        |     |     |     |               |       |:8188      |       |
    +-------+--------+-----+-----+-----+---------------+-------+-----------+-------+
    | serve | RUNNIN | nod | 100 | clu | 2022-07-19    | false | base-0.0. | jms,  |
    |r2     |G(00:00 |e2   |240  |ster1|(Tue) PM       |       |0.0:9936   |web,   |
    |       |:09)    |     |     |     |03:52:02 KST   |       | http-serv |ejb    |
    |       |        |     |     |     |               |       |er-0.0.0.0 |       |
    |       |        |     |     |     |               |       |:8288      |       |
    +-------+--------+-----+-----+-----+---------------+-------+-----------+-------+
    ================================================================================

6.2. Removing a Server from the Cluster

Servers in a cluster can be removed to reduce the size of a cluster. Shut down the server to remove a server from the cluster. Check and ensure that all running services are complete, and then remove the server from the cluster. This section describes how to remove a server from the cluster.

Using the Console Tool

The following are the steps for removing a server from the cluster using jeusadmin, a console tool.

The following are the steps for removing a server from a cluster when it has been configured by selecting servers.

  1. Shut down server2 by using the stop-server command. Refer to stop-server for detailed information about the stop-server command.

    [MASTER]domain1.adminServer>stop-server server2
    Stop server message to server [server2] was successfully sent.
  2. Remove server2 from cluster1 by using the remove-servers-from-cluster command. Refer to remove-servers-from-cluster for detailed information about the remove-servers-from-cluster command.

    [MASTER]domain1.adminServer>remove-servers-from-cluster cluster1 -servers server2
    Successfully performed the REMOVE operation for The server list for cluster(cluster1)..
    Check the results using "list-clusters cluster1 or remove-servers-from-cluster cluster1".
  3. Remove server2 by using the remove-server command if it is not to be used as an independent server. Refer to remove-server for detailed information about the remove-server command.

    [MASTER]domain1.adminServer>remove-server server2
    Successfully performed the REMOVE operation for server (server2).
    Check the results using "list-servers or remove-server"

7. Removing a Cluster

A cluster can be removed when a service does not need to run. Remove the cluster after shutting it down and then verifying that all the services have completed. This section describes how to remove a cluster.

Using the Console Tool

The following are the steps for removing a cluster using jeusadmin, a console tool.

  1. Shut down the cluster using the stop-cluster command. In this example, cluster1, which consists of server1 and server2 will be deleted. Refer to stop-cluster for detailed information about the stop-cluster command.

    [MASTER]domain1.adminServer>stop-cluster cluster1
    Stopping servers [server1, server2].
    Stop server message to the cluster [cluster1] was successfully sent.

    Run the serverinfo command to verify that the state of server1 and server2, which are in cluster1, is SHUTDOWN.

    [MASTER]domain1.adminServer>serverinfo
    ================================================================================
    +-------+---------+-----+-----+-----+--------------+-------+-----------+-------+
    | Server|  Status |Node | PID | Clu | Latest Start |  Need |   Listen  | Runni |
    |       |         |Name |     |ster |    Time /    |  to   |   Ports   |  ng   |
    |       |         |     |     |     |Shutdown Time |Restart|           |Engines|
    +-------+---------+-----+-----+-----+--------------+-------+-----------+-------+
    | admin | RUNNING | nod | 102 | N/A | 2022-07-19   | false | base-0.0. | jms,  |
    |Server |(00:02:4 |e1   |314  |     |(Tue) PM      |       |0.0:9736   |web,   |
    | (*)   |3)       |     |     |     |04:16:59 KST  |       | http-serv |ejb    |
    |       |         |     |     |     |              |       |er-0.0.0.0 |       |
    |       |         |     |     |     |              |       |:8088      |       |
    +-------+---------+-----+-----+-----+--------------+-------+-----------+-------+
    | serve | SHUTDOW | N/A | N/A | clu | 2022-07-19   | N/A   | N/A       | N/A   |
    |r1     |N(00:01: |     |     |ster1|(Tue) PM      |       |           |       |
    |       |03)      |     |     |     |04:18:39 KST  |       |           |       |
    +-------+---------+-----+-----+-----+--------------+-------+-----------+-------+
    | serve | SHUTDOW | N/A | N/A | clu | 2022-07-19   | N/A   | N/A       | N/A   |
    |r2     |N(00:01: |     |     |ster1|(Tue) PM      |       |           |       |
    |       |03)      |     |     |     |04:18:39 KST  |       |           |       |
    +-------+---------+-----+-----+-----+--------------+-------+-----------+-------+
    ================================================================================
  2. Remove the cluster by using the remove-cluster command. Refer to remove-cluster for detailed information about the remove-cluster command.

    [MASTER]domain1.adminServer>remove-cluster cluster1
    Successfully performed the REMOVE operation for cluster (cluster1).
    Check the results using "list-clusters or remove-cluster".
  3. After the cluster has been removed, delete the servers that belonged to the removed cluster unless they are to be used as independent servers. Remove server1 and server2 using the remove-server command. Refer to remove-server for detailed information about the remove-server command.

    [MASTER]domain1.adminServer>remove-server server1
    Successfully performed the REMOVE operation for server (server1).
    Check the results using "list-servers or remove-server"
    
    [MASTER]domain1.adminServer>remove-server server2
    Successfully performed the REMOVE operation for server (server2).
    Check the results using "list-servers or remove-server"