Chapter 4. Server Lifecycle

Table of Contents

4.1. Server Operation Mode
4.2. Preparing to Start the Server
4.3. Starting Servers
4.3.1. Starting the Domain Administration Server (DAS)
4.3.2. Starting a Managed Server (MS)
4.3.3. Starting a Cloud Server
4.4. Shutting Down Servers
4.4.1. Shutting Down the Domain Administration Server (DAS)
4.4.2. Shutting Down a Managed Server (MS)
4.4.3. Shutting Down a Cloud Server
4.5. Checking Server Lifecycle

This chapter describes how to start and close a server and check the server lifecycle.

4.1. Server Operation Mode

A JEUS server operates in one of two modes. In managed domain mode, multiple servers operate in a domain. In cloud server mode, a single server operates in cloud.

  • Managed domain mode

    Multiple servers are grouped in a domain and managed centrally through a domain management server.

  • Cloud server mode

    A JEUS server can start and operate independently in cloud.

    A cloud server supports both DAS and MS functions. To start and manage multiple could servers, users must manage them. For example, to deploy an application to all cloud servers, a user must deploy the application to each could server.

    To start a could server, you can use the startCloudServer script.

    Note that cloud servers are supported in Linux-series OS.

4.2. Preparing to Start the Server

Complete the following tasks to prepare for server startup.

  • JEUS must be installed and domains and servers must be created. A user name and password for starting and stopping the server must also be created in advance. If this task is not complete, set up the environment by following the steps in Installing and starting JEUS.

  • Node configuration is required to start a server via DAS by using WebAdmin or jeusadmin. Refer to JEUS Node Manager Guide for detailed information on node configuration.

    Node configuration is not required when a user starts the server manually by executing a script on the machine where each MS will be installed. But in such case, since the Node Manager cannot manage the MS it is recommended to configure the node.

  • Confirm that the JVM configuration for the server is configured in the xml file.

    Changing JVM settings requires a server restart. If it is not configured when the domain is created, start DAS to change the settings and then apply them by restarting DAS.

    If JVM settings are missing for an MS, start the server after adding JVM settings through WebAdmin or jeusadmin. Refer to "3.6.2. Changing a Server's JVM Settings" for the modification method.

  • Confirm that a server has an appropriate license.

    The license for an on-premise server is different from that for a cloud server. A server cannot start with an inappropriate license.

4.3. Starting Servers

This section describes how to start the Domain Administration Server (DAS), a Managed Server (MS), and a cloud server.

4.3.1. Starting the Domain Administration Server (DAS)

The startDomainAdminServer script is used to start DAS. It requires the domain name of DAS as well as a user name and password with the authority to start JEUS.

All three options are required if it is run from JEUS_HOME/bin. The domain name can be omitted if it is run from the DOMAIN_HOME path on DAS.

Run the script depending on the execution path.

  • JEUS_HOME/bin

    JEUS_HOME/bin$ startDomainAdminServer -domain <domain_name> -u <user_name> -p <password>
  • DOMAIN_HOME/bin

    DOMAIN_HOME/bin$ startDomainAdminServer -u <user_name> -p <password>
  • SERVER_HOME/bin

    SERVER_HOME/bin$ startDomainAdminServer -u <user_name> -p <password>

Once the DAS's state becomes RUNNING, server log is recorded in the file, SERVER_HOME/logs/JeusServer.log. To monitor the server log in console tool, use the -verbose option. The server process and the launcher process both run on DAS. The launcher process runs the server process and outputs logs to the console tool.

Use the jps command to check LauncherBootStrapper and DomainAdminServerBootstrapper.

jps -l
399092 jeus.server.LauncherBootstrapper
409880 sun.tools.jps.Jps
398868 jeus.server.NodemanagerBootstrapper
399352 jeus.server.admin.DomainAdminServerBootstrapper

If the server fails to start, check the cause in SERVER_HOME/logs/JeusLauncher.log.

Note

1. Jps is a tool, which is in the JAVA_HOME/bin directory, that lists the Java processes.

2. For detailed information about the Launcher, refer to JEUS Server Guide. "1.5. Launcher".

4.3.2. Starting a Managed Server (MS)

An MS can be started using either DAS or a script.

Using DAS

DAS can be used to start an MS if DAS is running and the SSH information of the MS is configured.

An MS can be started using DAS with WebAdmin or the console tool.

  • Using WebAdmin

    Click [Servers] from the left menu to go to the list of servers. Click [Start] on a server to start it. A message is displayed to notify that the server has started successfully.

  • Using the console tool

    The start-server command can be used in jeusadmin to start an MS as in the following example.

    [DAS]domain1.adminServer>start-server server1
    The server [server1] was successfully started.

    Note

    For detailed information about the start-server command, refer to JEUS Reference Book. "4.2.3.44. start-server".

Using a Script

An MS can be started using a script instead of DAS.

If multiple servers are distributed on multiple machines in the domain, run the script on each machine that hosts the MS. The name of the script is startManagerServer, and dasurlsetting must be configured in order to synchronize the settings with DAS.

Note

If dasurl is not configured, MS will start in the INDEPENDENT mode. After DAS finds the MS, it is managed by DAS. If DAS has not started, dasurl can be omitted so that the MS can start in the INDEPENDENT mode. Otherwise, it is recommended to configure dasurl. For detailed information about INDEPENDENT mode, refer to "6.1.3. Managed Servers (MSs) in INDEPENDENT Mode".

The following shows how to execute the startManagedServer script from different locations.

  • JEUS_HOME/bin

    JEUS_HOME/bin$ startManagedServer -dasurl <das_ip:das_baseport> -domain <domain_name> -server <server_name> -u <user_name> -p <password>
  • DOMAIN_HOME/bin

    DOMAIN_HOME/bin$ startManagedServer -dasurl <das_ip:das_baseport> 
    -server <server_name> -u <user_name> -p <password>
  • SERVER_HOME/bin

    SERVER_HOME/bin$ startManagedServer -dasurl <das_ip:das_baseport> 
    -u <user_name> -p <password>

4.3.3. Starting a Cloud Server

The startCloudServer script is used to start a could server. It requires the server's name and domain name as well as a user name and password with the authority to start JEUS. If there is only one domain, the server's name and domain name can be omitted. If there are multiple domains, the domain name must be specified but the server name can be omitted.

All those options are required if it is run from JEUS_HOME/bin. The server's name and domain name can be omitted if it is run from the DOMAIN_HOME path. The command differs depending on the execution path.

Run the script depending on the execution path.

  • JEUS_HOME/bin

    JEUS_HOME/bin$ startCloudServer -domain <domain_name> -u <user_name> -p <password>
  • DOMAIN_HOME/bin

    DOMAIN_HOME/bin$ startCloudServer -u <user_name> -p <password>
  • SERVER_HOME/bin

    SERVER_HOME/bin$ startCloudServer -u <user_name> -p <password>

Once the cloud server's state becomes RUNNING, server log is recorded in the file, SERVER_HOME/logs/JeusServer.log. To monitor the server log in console tool, use the -verbose option.

Use the jps command to check DomainAdminServerBootstrapper.

jps -l
              409880 sun.tools.jps.Jps
              398868 jeus.server.NodemanagerBootstrapper
          399352 jeus.server.admin.DomainAdminServerBootstrapper

If the server fails to start, check the cause in SERVER_HOME/logs/JeusLauncher.log.

Note

1. Jps is a tool, which is in the JAVA_HOME/bin directory, that lists the Java processes.

2. Cloud servers do not use Launcher.

4.4. Shutting Down Servers

This section describes how to shut down the Domain Administration Server (DAS), a Managed Server (MS), and a cloud server.

4.4.1. Shutting Down the Domain Administration Server (DAS)

To shut down the DAS, use either the console tool (jeusadmin) or a script.

Using the Console Tool

DAS can be shut down after stopping all managed servers (refer to "4.4.2. Shutting Down a Managed Server (MS)").

Run the following local-shutdown command.

[DAS]domain1.adminServer>local-shutdown

Using a Script

Use a script installed in a machine where the DAS is located.

Run the following stopServer script depending on the location.

  • JEUS_HOME/bin

    JEUS_HOME/bin$ stopServer -host <server_ip:server_baseport> -u <user_name> -p <password> 
  • DOMAIN_HOME/bin

    DOMAIN_HOME/bin$ stopServer -host <server_ip:server_baseport> -u <user_name> -p <password> 
  • SERVER_HOME/bin

    SERVER_HOME/bin$ stopServer -host <server_ip:server_baseport> -u <user_name> -p <password> 

4.4.2. Shutting Down a Managed Server (MS)

An MS can be shut down using either DAS or a script.

Using DAS

An MS can be shut down using DAS with WebAdmin or the console tool.

  • Using WebAdmin

    Click [Servers] from the left menu to go to the list of servers. Click [Stop] next to a server to stop it.

    JEUS supports graceful server shutdown, which handles pending requests before shutting down. Enter the amount of time to wait for incomplete requests in the 'Timeout' field and click [OK].

    [Figure 4.1] Shutting Down an MS Via DAS - Configuration

    Shutting Down an MS Via DAS - Configuration

    A message is displayed that the server has been shut down successfully.

    Note

    For detailed information about graceful server shutdown, refer to JEUS Server Guide. "3.1.3. Shutting Down a Managed Server".

  • Using the console tool

    Managed servers can be shut down by DAS using the stop-server command in jeusadmin, as shown in the following example. For detailed information about the stop-server command, refer to JEUS Reference Book. "4.2.3.47. stop-server".

    [DAS]domain1.adminServer>stop-server <server_list>

Using a Script

An MS can be shut down using a script which is installed on the server. If multiple servers are distributed on multiple machines in the domain, run the script on each machine that hosts the MS.

The following shows how to execute the stopServer script from different locations.

  • JEUS_HOME/bin

    JEUS_HOME/bin$ stopServer -host <server_ip:server_baseport> -u <user_name> -p <password>
  • DOMAIN_HOME/bin

    DOMAIN_HOME/bin$ stopServer -host <server_ip:server_baseport> -u <user_name> -p <password>
  • SERVER_HOME/bin

    SERVER_HOME/bin$ stopServer -host <server_ip:server_baseport> -u <user_name> -p <password>

4.4.3. Shutting Down a Cloud Server

To shut down a cloud server, use either the console tool (jeusadmin) or a script.

Using the Console Tool

Run the following local-shutdown command.

[DAS]domain1.adminServer>local-shutdown

Using a Script

Use a script installed in a machine where the server is located.

Run the following stopServer script depending on the location.

  • JEUS_HOME/bin

    JEUS_HOME/bin$ stopServer -host <server_ip:server_baseport> -u <user_name> -p <password>
  • DOMAIN_HOME/bin

    DOMAIN_HOME/bin$ stopServer -host <server_ip:server_baseport>  -u <user_name> -p <password>
  • SERVER_HOME/bin

    SERVER_HOME/bin$ stopServer -host <server_ip:server_baseport> -u <user_name> -p <password>

4.5. Checking Server Lifecycle

DAS determines the lifecycle of the managed servers.

[Figure 4.2] Server Lifecycle

Server Lifecycle


The following describes each state.

StateDescription
SHUTDOWNServer has not been started or has been shut down normally.
STARTINGServer is in the startup process, but is not ready to run services.
STANDBYThe server is not in the RUNNING state yet because some applications failed to be distributed during startup. Modify the problematic application or use the force option with the start command to ignore the error and start the server.
RUNNINGServer is running and is ready to provide services.
SHUTTING_DOWNServer is shutting down.
SUSPENDINGServer, in the running state, is suspending all running applications.
RESUMINGServer is resuming previously suspended applications.
SUSPENDEDAll applications have been suspended. This state allows new applications to be distributed, but they cannot run.
FAILURE_SUSPECTEDDAS suspects that the MS may have shut down abnormally because it cannot connect to the MS.
FAILEDDAS has determined that the MS has shut down abnormally because it has not been connected for a specific period of time.

Note

DAS checks MS state by using System Clustering Framework (SCF).

SCF is a module that allows servers in a domain to check other servers' state and to send/receive messages to/from other servers. Since it uses a network, it can recognize communication delay caused by a network issue (such as a remote server's load) as an error. If the issue is resolved, it recognizes the state as normal.

SCF uses multicast by default, but it can use virtual multicast if the environment does not support multicast or there is a specific request. Virtual multicast allows socket communication between servers in a domain.

The following are the three ways to check for the server state.

  • Using an MBean

    Server states can be monitored using J2EEDomain#getServerState (String serverName). Refer to JEUS JMX Guide for detailed information about MBeans.

  • Using WebAdmin

    Click [Monitoring] > [Servers] from the left menu to go to the screen with the list of servers and domain information. The server state is displayed in the 'Status' column.

    [Figure 4.3] Checking Server Status - Server Monitoring

    Checking Server Status - Server Monitoring

  • Using the console tool (jeusadmin)

    Server statuses can be checked using the following serverinfo command in the console tool.

    [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 |node1|399352 | N/A | 2016-08-23     | false   | base-0.0.   | jms,        |
    |rver(*) |(01:40:40|     |       |     |(Tue) PM        |         |0.0:9736     | ejb, web    |
    |        |)        |     |       |     |03:53:28 KST    |         | http-server-|             |
    |        |         |     |       |     |                |         |0.0.0.0:8088 |             |
    |        |         |     |       |     |                |         |jms-0.0.0    |             |
    |        |         |     |       |     |                |         |.0:9741      |             |
    +--------+---------+-----+-------+-----+----------------+---------+-------------+-------------+
    | server1| RUNNING |node1| N/A   | clus| 2016-08-23     | N/A     | base-192.168| jms,        |
    |        |(01:31:03|     |       |ter1 |(Tue) PM        |         |.34.1:9836   | ejb, web    |
    |        |)        |     |       |     |04:03:05 KST    |         |             |             |
    +--------+---------+-----+-------+-----+----------------+---------+-------------+-------------+
    | server2| SHUTDOWN|node1| N/A   | clus| 2016-08-23     | N/A     | N/A         | N/A         |
    |        |(01:31:03|     |       |ter1 |(Tue) PM        |         |             |             |
    |        |)        |     |       |     |04:03:05 KST    |         |             |             |
    +--------+---------+-----+-------+-----+----------------+---------+-------------+-------------+
    ===============================================================================================

    Note

    For more information about the serverinfo command, refer to JEUS Reference Book. "4.2.3.39. server-info".