Chapter 5. JEUS Clustering

Table of Contents

5.1. Overview
5.2. Relationship between Clusters and Domain
5.3. Cluster Features
5.4. Creating a Cluster
5.5. Configuring a Cluster
5.5.1. Common Server Settings
5.5.2. Cluster Settings
5.5.3. Dynamic Server Cluster Settings
5.6. Modifying a Cluster
5.6.1. Adding a Server to the Cluster
5.6.2. Removing a Server from the Cluster
5.7. Removing a Cluster

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.

5.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.

5.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.

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

[Figure 5.1] Relationship Between Clusters and Domain

Relationship Between Clusters and Domain


5.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.

ServiceDescription

Servlets

/Jsps

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

Refer to JEUS Web Engine Guide. "2.4. Configuring Web Server Load Balancing" for detailed information about web application clustering using the web server and refer to JEUS Session Management Guide. "Chapter 2. Distributed Session Servers" for information about HTTP session clustering.

EJB

EJB engines support session beans, message-driven beans, entity beans, and timer service clustering.

Refer to JEUS EJB Guide. "Chapter 6. EJB Clustering" for detailed information about clustering in EJB engines.

JMS

JMS supports connection factory, destination, and durable subscriber clustering.

Refer to JEUS MQ Guide. "Chapter 4. JEUS MQ Clustering" for detailed information about clustering in JMS.

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.

5.4. Creating a Cluster

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

5.5. Configuring a Cluster

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

5.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.

Note

Refer to JEUS Server Guide. "Chapter 2. JEUS Configuration" for detailed information on common server settings

5.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.

Note

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

5.5.3. Dynamic Server Cluster Settings

New servers can be created with settings in a server template and added to a cluster. Set up a server template, and choose 'Dynamic Servers' on the cluster adding page. If users want to change settings of the cluster configured in 'Dynamic Servers', they need to change the cluster settings or the server template. For more information about a server template, refer to JEUS Server Guide. "2.4. Server Template Configuration".

A server template can be created using WebAdmin or the console tool.

  • Using WebAdmin

    1. Click [Servers] and to go to the server and template list.

    2. Click the [Add] button to the right of the 'Server Templates' to view the add template screen.

    3. Specify the name of a template in 'Name' and other items and then click [OK] at the top right hand corner to save the settings.

    4. The new template is listed in [Servers].

  • Using the console tool

    Use add-server-template to specify detailed settings of a server template. Specify the name of a template and other settings. For more information, refer to JEUS Reference Book. "4.2.4.9. add-server-template".

Changes to the settings of a cluster created with dynamic servers can be made only in the cluster settings or the server template settings. The settings of one server cannot be changed individually unless a cluster is configured by adding individual servers. The name of each server takes the format of the the value specified in 'Server Name Prefix' followed by a number.

The listen address of each server is set to the value configured for each node in nodes.xml. To specify a node to locate dynamic servers in 'Node Names', use the configuration information of nodes.xml. Nodes are allocated based on the round-robin mechanism.

To add or delete a server, use 'Server Count' of the cluster setting. Servers cannot be added or deleted individually. The detailed setting of dynamic servers also cannot be changed individually but always updated based on the setting of the server template.

5.6. Modifying a Cluster

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

5.6.1. Adding a Server to the Cluster

This section describes how to add a server to the cluster using WebAdmin or jeusadmin, a console tool.

Note

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.

Using WebAdmin

The following are the steps for adding a server to a cluster in WebAdmin.

  1. Click [Servers] from the left menu to go to the list of servers.

  2. Click [Lock & Edit] to change to the configuration mode. Refer to JEUS WebAdmin Guide. "2.3.2. Menu" for detailed information about the configuration mode in WebAdmin.

  3. The method for adding servers to a cluster depends on the manner a cluster is configured.

    • Configuring a cluster by creating servers and adding them

      The following are the steps for creating servers and adding them to a cluster. Users can configure settings for a new server and select it in the list to add to a cluster.

      1. On the Servers screen, click [Add] to go to [Basic] > [Basic Info]. Configure the settings for a new server and then click [OK].

      2. Once a server is added to the server list, add it to a cluster. Click [Clusters] to go to the cluster list screen. Select a cluster from the list so that a server can be added.

      3. Select the server in 'Servers' on the Cluster screen and then click [OK].

    • Configuring a cluster using the dynamic servers setting

      The following are the steps for configuring a cluster using the dynamic servers setting. A server can be automatically added on the cluster settings page by changing the cluster settings.

      1. To add servers by changing the cluster settings, click [Clusters] and go to the cluster list page.

      2. In the 'Server Count' field under 'Dynamic Servers', enter a number of servers greater than the current one and then click [OK]. The number of servers is increased by the difference between the updated server count and the previous one.

  4. Confirm the message that cluster settings have been changed, and then click [Apply Changes] to save the changes.

  5. A message is displayed that a server or servers have been created and added to the cluster.

  6. Click [Clusters] from the left menu, and then click [Start] of the cluster to start the servers.

  7. Verify that the servers are running properly in the cluster by clicking [Monitoring] > [Servers].

Using the Console Tool

The following are the steps for adding a server to the cluster using jeusadmin, a console tool. A cluster can be configured either by creating and adding a server or by using dynamic servers.

  • Configuring a cluster by creating servers and adding them

    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 JEUS Reference Book. "4.2.4.7. add-server" for detailed information about the add-server command.

      [DAS]domain1.adminServer>add-server server2 -node node2 -addr 192.168.34.2 -port 9936
      Successfully performed the ADD operatioin for server (server2).
      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 JEUS Reference Book. "4.2.4.8. add-servers-to-cluster" for detailed information about the add-servers-to-cluster command.

      [DAS]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 added server by using the start-cluster command. Refer to JEUS Reference Book. "4.2.3.45. start-cluster" for detailed information about the start-server command.

      [DAS]domain1.adminServer>start-cluster cluster1
      The cluster [cluster1] has been successfully started.
    4. Check that server1 and server2 are running properly in 'cluster1' by using the serverinfo command.

      [DAS]domain1.adminServer>serverinfo
      
      Information about Domain (domain1)
      ==============================================================================================
      +--------+---------+-----+-------+-----+----------------+--------+-------------+-------------+
      | Server |  Status | Node|  PID  | Clus|  Latest Start  | Need to| Listen Ports| Running     |
      |        |         |Name |       | ter |Time / Shutdown |Restart |             | Engines     |
      |        |         |     |       |     |     Time       |        |             |             |
      +--------+---------+-----+-------+-----+----------------+--------+-------------+-------------+
      | adminSe| RUNNING | N/A | 5360  | N/A | 2016-08-23     | false  | base-192.168| jms,        |
      |rver(*) |(00:01:11|     |       |     |(Tue) PM        |        |.34.3:9736   | ejb, web    |
      |        |)        |     |       |     |03:53:28 KST    |        | http-server-|             |
      |        |         |     |       |     |                |        |0.0.0.0:8088 |             |
      |        |         |     |       |     |                |        |jms-internal-|             |
      |        |         |     |       |     |                |        |0.0.0.0:9741 |             |
      +--------+---------+-----+-------+-----+----------------+--------+-------------+-------------+
      | server1| RUNNING |node1| 6424  | clus| 2016-08-23     | false  | base-192.168| jms,        |
      |        |(00:00:03|     |       |ter1 |(Tue) PM        |        |.34.1:9836   | ejb, web    |
      |        |)        |     |       |     |03:54:37 KST    |        |             |             |
      --------+---------+-----+-------+-----+-----------------+--------+-------------+-------------+
      | server2| RUNNING |node2| 3012  | clus| 2016-08-23     | false  | base-192.168| jms,        |
      |        |(00:00:03|     |       |ter1 |(Tue) PM         |        |.34.2:9936   | ejb, web    |
      |        |)        |     |       |     |03:54:36 KST    |        |             |             |
      +--------+---------+-----+-------+-----+----------------+--------+-------------+-------------+
      ==============================================================================================
  • Configuring a cluster using the dynamic servers setting

    The following are the steps for configuring a cluster using the dynamic servers setting.

    1. Use the modify-dynamic-servers command to add dynamic servers to a cluster. For details about using the modify-dynamic-servers command, refer to JEUS Reference Book. "4.2.4.21. modify-dynamic-servers".

      [DAS]domain1.adminServer>modify-dynamic-servers cluster1 -count 3 -nodes node1 -template temp1
      Successfully performed the MODIFY operation for Dynamic servers configuration in the cluster (cluster1), 
      but some changes were non-dynamic. They will be applied after restarting.
      Check the results using "modify-dynamic-servers or show-dynamic-servers". 
    2. Use the show-dynamic-servers command to verify that the dynamic servers have been added.

      [DAS]domain1.adminServer>show-dynamic-servers cluster1
      Shows the current configuration.
      Dynamic servers configuration in the cluster (cluster1)
      ====================================================================
      +----------------------------------------------------------+-------+
      | Server Count                                             | 3     |
      | Nodes                                                    | node1 |
      | Base Listen Port                                         | 9736  |
      | HTTP Listen Port                                         | 8088  |
      | JMS Listen Port                                          | 9741  |
      | Server Template Name                                     | temp1 |
      | Listen Port Step                                         | 100   |
      +----------------------------------------------------------+-------+
      ====================================================================

5.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 to make sure 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 WebAdmin and jeusadmin.

Using WebAdmin

The following are the steps for removing a server from the cluster in WebAdmin.

  1. Click [Servers] from the left menu to go to the list of servers. Click [Stop] to shut down the server to remove.

  2. Click [Lock & Edit] to change to the configuration mode. Refer to JEUS WebAdmin Guide. "2.3.2. Menu" for detailed information about the configuration mode in WebAdmin.

  3. Click [Clusters] to go to the list of clusters. Click the cluster that contains the server to remove.

  4. The method for adding servers to a cluster depends on the manner a cluster is configured.

    • When a cluster is configured by selecting servers

      The following are the steps for removing servers from a cluster. Users can remove a server from a cluster by deselecting it on the server list.

      1. To change the cluster settings, click [Clusters] to go to the cluster list screen.

      2. Deselect a server from 'Servers' and then click [OK].

      3. Delete the server removed from the cluster unless users want to use it as an independent server. Click [Servers] to see the server list and then click [Delete].

    • When a cluster is configured using the dynamic server setting

      The following are the steps for removing a server form a cluster configured with dynamic servers. Users can remove a server by changing the cluster settings.

      1. To change the cluster settings, click [Clusters] to go to the cluster screen.

      2. In the 'Server Count' field under 'Dynamic Servers', enter a number smaller than the current one and then click [OK]. The number of servers is decreased by the difference between the updated server count and the previous one.

  5. Verify that the server has been removed, and then click [Apply Changes] to apply the changes.

  6. A message is displayed that the server has been removed from the cluster and deleted.

Using the Console Tool

The following are the steps for removing a server from the cluster using jeusadmin, a console tool. As above, the method of removing a server depends on whether a cluster is created by adding servers or not.

  • When a cluster is configured by selecting servers

    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 JEUS Reference Book. "4.2.3.50. stop-server" for detailed information about the stop-server command.

      [DAS]domain1.adminServer>stop-server server2
      Server [server2] was successfully stopped.
    2. Remove server2 from cluster1 by using the remove-servers-from-cluster command. Refer to JEUS Reference Book. "4.2.4.29. remove-servers-from-cluster" for detailed information about the remove-servers-from-cluster command.

      [DAS]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 JEUS Reference Book. "4.2.4.28. remove-server" for detailed information about the remove-server command.

      [DAS]domain1.adminServer>remove-server server2
      Successfully performed the REMOVE operation for server (server2).
      Check the results using "list-servers or remove-server"
  • When a cluster is configured using the dynamic server setting

    The following are the steps for removing a server from a cluster when it has been configured using the dynamic server setting.

    1. Use the modify-dynamic-servers command to remove dynamic servers from cluster1. The number of servers is decreased to the configured number by removing the servers. Refer to JEUS Reference Book. "4.2.4.21. modify-dynamic-servers" for more information about the modify-dynamic-servers command.

      [DAS]domain1.adminServer>modify-dynamic-servers cluster1 -count 1 -nodes node1 -template temp1
      Successfully performed the MODIFY operatTo dion for Dynamic servers configuration in the cluster (cluster1), 
      but some changes were non-dynamic. They will be applied after restarting.
      Check the results using "modify-dynamic-servers or show-dynamic-servers".
    2. Use the show-dynamic-servers command to verify that the dynamic servers have been removed.

      [DAS]domain1.adminServer>show-dynamic-servers cluster1 
      
      Shows the current configuration.
      Dynamic servers configuration in the cluster (cluster1)
      ====================================================================
      +----------------------------------------------------------+-------+
      | Server Count                                             | 1     |
      | Nodes                                                    | node1 |
      | Base Listen Port                                         | 9736  |
      | HTTP Listen Port                                         | 8088  |
      | JMS Listen Port                                          | 9741  |
      | Server Template Name                                     | temp1 |
      | Listen Port Step                                         | 100   |
      +----------------------------------------------------------+-------+
      ====================================================================

5.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 WebAdmin and jeusadmin.

Using WebAdmin

The following are the steps for removing a cluster in WebAdmin.

  1. Click [Lock & Edit] to change to the configuration mode.

    Refer to JEUS WebAdmin Guide. "JEUS WebAdmin manual" for detailed information about the configuration mode in WebAdmin.

  2. Click [Clusters] from the left menu to go to the list of clusters. Click [Stop] to stop the cluster.

  3. After stopping the cluster, click [Delete] to remove it.

    • To delete the servers removed from the cluster, click [Servers] to go to the server list screen and then click [Delete].

    • When a cluster configured with dynamic servers is deleted, they are deleted automatically.

  4. Verify that the cluster has been removed, and then click [Apply Changes] to apply the changes.

  5. A message is displayed that cluster1 and the servers belonging to it have been deleted.

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 JEUS Reference Book. "4.2.3.48. stop-cluster" for detailed information about the stop-cluster command.

    [DAS]domain1.adminServer>stop-cluster cluster1
    The cluster [cluster1] was successfully stopped.

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

    [DAS]domain1.adminServer>serverinfo
    
    Information about Domain (domain1)
    ==============================================================================================
    +--------+---------+-----+-------+-----+----------------+--------+-------------+-------------+
    | Server |  Status | Node|  PID  | Clus|  Latest Start  | Need to| Listen Ports| Running     |
    |        |         |Name |       | ter |Time / Shutdown |Restart |             | Engines     |
    |        |         |     |       |     |     Time       |        |             |             |
    +--------+---------+-----+-------+-----+----------------+--------+-------------+-------------+
    | adminSe| RUNNING | N/A | 5360  | N/A | 2016-08-23     | false  | base-192.168| jms,        |
    |rver(*) |(00:09:48|     |       |     |(Tue) PM        |        |.34.3:9736   | ejb, web    |
    |        |)        |     |       |     |03:53:28 KST    |        | http-server-|             |
    |        |         |     |       |     |                |        |0.0.0.0:8088 |             |
    |        |         |     |       |     |                |        |jms-internal-|             |
    |        |         |     |       |     |                |        |0.0.0.0:9741 |             |
    +--------+---------+-----+-------+-----+----------------+--------+-------------+-------------+
    | server1| SHUTDOWN|node1| N/A   | clus| 2016-08-23     | N/A    | N/A         | N/A         |
    |        |(00:00:11|     |       |ter1 |(Tue) PM        |        |             |             |
    |        |)        |     |       |     |04:03:05 KST    |        |             |             |
    +--------+---------+-----+-------+-----+----------------+--------+-------------+-------------+
    | server2| SHUTDOWN|node2| N/A   | clus| 2016-08-23     | N/A    | N/A         | N/A         |
    |        |(00:00:11|     |       |ter1 |(Tue) PM        |        |             |             |
    |        |)        |     |       |     |04:03:05 KST    |        |             |             |
    +--------+---------+-----+-------+-----+----------------+--------+-------------+-------------+
    ==============================================================================================
  2. Remove the cluster by using the remove-cluster command. Refer to JEUS Reference Book. "4.2.4.22. remove-cluster" for detailed information about the remove-cluster command.

    [DAS]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, the servers need to be processed differently according to the situation.

    • Servers that were created dynamically are deleted once the cluster is deleted.

    • 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 JEUS Reference Book. "4.2.4.28. remove-server" for detailed information about the remove-server command.

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