Chapter 4. Server Lifecycle

Table of Contents

4.1. Preparing to Start the Server
4.2. Starting the Server
4.2.1. Starting Domain Administration Server (DAS)
4.2.2. Starting a Managed Server (MS)
4.3. Shutting Down the Server
4.3.1. Shutting Down a Managed Server (MS)
4.3.2. Shutting Down Domain Administration Server (DAS)
4.4. Checking Server Lifecycle

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

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

  • Check 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.

4.2. Starting the Server

This section describes how to start the Domain Administration Server (DAS) and Managed Servers (MSs).

4.2.1. Starting 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. The command differs 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>

After DAS starts, it creates a server log in SERVER_HOME/logs/JeusServer.log, which can be monitored by using the console tool with 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 the 'SERVER_HOME/logs/JeusLauncher.log'.

Note

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

2. Refer to JEUS Server Guide. "1.6. Launcher" for detailed information about the Launcher.

4.2.2. Starting a Managed Server (MS)

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

Starting a Managed Server 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

    Refer to JEUS Reference Book. "4.2.3.47. start-server" for detailed information about the start-server command.

Starting an MS Using a Script

A Managed Server 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 dasurl setting 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. Refer to "6.1.3. Managed Servers (MSs) in INDEPENDENT Mode" for detailed information about INDEPENDENT mode.

The following shows how to execute the startManagedServer command 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. Shutting Down the Server

This section describes how to shut down DAS and managed server.

4.3.1. Shutting Down a Managed Server (MS)

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

Shutting Down an MS 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

    Refer to JEUS Server Guide. "3.1.3. Shutting Down a Managed Server" for detailed information about graceful server shutdown.

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

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

Shutting Down an MS via a Script

A Managed Server 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 command 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.3.2. Shutting Down Domain Administration Server (DAS)

DAS can be shut down using either jeusadmin or a script.

  • Using jeusadmin

    DAS can be shut down after stopping all managed servers. Run the following local-shutdown command.

    [DAS]domain1.adminServer>local-shutdown
  • Using a script

    DAS can be shut down using a script.

    Run the following stopServer command 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. 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.
FAILUREDAS has determined that the MS has shut down abnormally because it has not been connected for a specific period of time.

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 manual" 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

    Server statuses can be checked using the following serverinfo command in the console tool. Refer to JEUS Reference Book. "4.2.3.43. server-info" for detailed information about 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 |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

    Refer to JEUS Reference Book. "4.2.3.43. server-info" for more information about the serverinfo command.