Chapter 2. Java Node Manager

Table of Contents

2.1. Overview
2.2. Operation of Each Function
2.2.1. Starting Managed Servers on a Remote Machine
2.2.2. Monitoring Servers
2.2.3. Restarting a Server that is in an Abnormal State
2.2.4. Rolling Patch
2.2.5. Connecting to DAS
2.3. Configuration Environment
2.3.1. Configuration File
2.3.2. Required Files
2.4. Configuring and Deleting Nodes
2.4.1. Configuring Java Type Node
2.4.2. Deleting a Java Node
2.5. Starting and Terminating the Node Manager
2.6. Controlling Servers Using the Java Node Manager
2.7. Log Files

This chapter describes how to configure and operate the Java node manager.

The Java node manager can detect the abnormal termination of a server faster than the SSH node manager. The SSH node manager cannot be used if the OS is Windows. The Java node manager can be used regardless of the OS.

This chapter describes the basic knowledge that is required to use the Java node manager.

This section describes how each Java node manager function works.

The Java node manager monitors the state of server processes regularly to update the state file. If an error occurs, the node manager restarts the server process.

The node manager does not monitor all the servers on a node, but only the server processes that were started through the node manager. Therefore, to restart a server immediately in case of an error occurrence, the server must be started by the node manager.

The following shows the process of the Java node manager monitoring a server.


Even when a node manager is restarted, it continues to monitor the server that it started.

The following shows how a node manager finds the server that it was monitoring after it is restarted.

  1. When a node manager is restarted, the node manager finds the domain names that are managed by the node manager in the following path.

    JEUS_HOME/domains
  2. The node manager finds the server names that are managed by the node manager in the server directory in the following path.

    JEUS_HOME/domains/<domain-name>/servers
  3. It checks if the files <serverName>.address, <serverName>.lck, <serverName>.state, <serverName>.pid are in the server directory. If all the files exist, then it knows that the server is running.

  4. It gets FILE LOCK from the lock file.

  5. It checks the server state in the state file and determines whether the server can run the services.

    • A service can run if it is in one of the following states: RUNNING, STANDBY, SUSPENDED, RESUMING, SUSPENDING, and STARTING

    • A service cannot run if it is in one of the following states: SHUTDOWN and SUNTTING_DOWN

  6. It checks if the process is running with the server process ID in the pid file.

    If the server is down, the node manager restarts the server.

  7. It makes a socket connection based on the host information of the server that is recorded in the address file and checks if the server process is running normally.

    If the server is down, the node manager restarts the server.

  8. If it is determined that the server is ready to run the services, the node manager monitors the server by regularly checking the server state.

Note

The SHUTDOWN_NEED_TO_RESTART state in the state file is used to restart the server, which was previously running on the node, when the node manager restarts. It is usually used to restart the previously running server after a server shutdown when the node manager is registered as an OS service, like a windows service.

A patch can be applied to a domain by using the Java node manager. The node manager can send a patch file to the servers on remote machines or can delete the patch file. The node manager can also restart the servers on remote machines to apply the patch.

DAS can access node managers on remote machines to send, delete, or apply a patch file.

This section describes how to configure the environment needed for using the Java node manager.

The following files must be configured in order to use the Java node manager which requires other configuration in addition to the nodes.xml file.

nodes.xml

Includes node information about which node manager type to use. The nodes.xml file is in the following location.

JEUS_HOME/domains

The nodes.xml, which is referenced by DAS, defines the physical address of the node. The information of the node where each MS is running is defined in the domain configuration.

This file is shared by multiple domains where the installed JEUS belongs to. DAS in each domain accesses the node manager of each node according to the configuration in the node.xml file.

Nodes can be added or deleted using WebAdmin or the console tool. For more information, refer to WebAdmin or "2.4. Configuring and Deleting Nodes".

The machine settings in the node.xml file and the "host" and "port" settings in the jeusnm.properties file must match.

jeusnm.properties

The jeusnm.properties is a configuration file that defines how the node manager works, and it is in the following path.

JEUS_HOME/nodemanager

The following are the configuration items that can be set in the jeusnm.properties file which must be modified manually.

ItemDescription
useNodeManagerOption to use the Java node manager. (Default: true)
hostListen address of the node manager. (Default: localhost)
portListen port of the node manager. (Default: 7730)
useSSLListenerOption to set the node manager to use SSL. (Default: false)
serverMonitoringPeriodMonitoring cycle for the server process state. (Default: 500, Units: ms)
serverAutoRestartOption to reboot the server automatically if the server process has been terminated abnormally. (Default: true)
serverRestartTryCount

Retry count for server restart. (Default: 5)

If the attempts to restart the server exceeds this value during the time set in 'serverRestartDurationTime', it is determined that there's a problem with the server process, and server restart will no longer be attempted.

serverRestartDurationTime

Server restart cycle. (Default: 120000, Units: ms)

If the number of server restart attempts during this cycle exceeds the value set in "serverRestartTryCount" then it is determined that there is a problem with the server process and server restart will no longer be attempted.

serverRetryRestartOption to retry restarting the server when the attempt to restart the server fails. If set to true, the server is restarted until it starts successfully. (Default: false)
logFile

Path where the log file of the node manager exists.

If using an absolute file path, a log file is created in the path. If a relative file path is used, a log file is created in the default log directory.

(Default: JEUS_HOME/nodemanager/logs/JeusNodeManager.log)

keystore

Path to the keystore file that is used during authentication when SSL is used.

(Default: DOMAIN_CONFIG_HOME/keystore)

keystorePass

Password of the keystore file that is used during authentication when SSL is used.

(Default: jeuskeypass)

truststore

Path to the truststore file that is used during authentication when SSL is used.

(Default: DOMAIN_CONFIG_HOME/truststore)

truststorePass

Password of the truststore file that is used during authentication when SSL is used.

(Default: jeustruststorepass)

<serverName>.properties

The <serverName>.properties file is the cache file that stores the information that is required to restart the server. The file is created in the following path after the server is restarted by the node manager.

SERVER_HOME/nodemanager

The node manager can store the options that are required to start the server in a file and can use it to start the server. This information is used only when the node manager starts the server directly using the console tool. The options are not used when an MS is started by DAS, .

The following are the cached items.

ItemDescription
dasurlHost information of DAS. Dasurl is cached only for MSs.
usernameServer account that is required to start the server.
passwordServer password that is required to start the server.
sslArgumentsSSL properties information that is required for SSL authentication when the node manager accesses the server and the server uses SSL.

The following describes the additional files that are required for the node manager to start and monitor the server. Each file is located in the following path.

JEUS_HOME/domains/<domain_name>/servers/<server_name>/nodemanager

WebAdmin or the console tool is used to configure or delete Java nodes.

This section describes how to use WebAdmin and the console tool to configure a Java node.

Note

To start a server using WebAdmin or the console tool, the node name must be configured on the server.

Using WebAdmin

The following shows how to configure a Java node using WebAdmin.

  1. All node-related settings can be configured from the [Node Configuration] menu. Select [Node Configuration] from the main page of WebAdmin.

  2. On the Nodes page, a list of existing nodes is displayed. The list contains the nodes that were automatically created when the JEUS instance was installed even if the user did not add any nodes. Click [Add] to add a node.

    Note

    The node configuration can be changed or applied without clicking [Lock & Edit] or [Apply Changes].

  3. Enter the node name and host information of the name that is configured from the Node page. Select "Java" as the node type, and then enter the configuration items and click [OK].

  4. If the node is added successfully, a success message is displayed on the upper part of the Nodes page and the node information is displayed.

Using the Console Tool

The following shows how to configure a node using the console tool.

  1. Add a node named node1 by using the add-java-node command.

    [DAS]domain1.adminServer>add-java-node node1 -host 192.168.34.65 -port 7730
    The node [node1] was successfully added.
  2. Check the configuration of the added node by using the show-node command. The following Java node "node1" is displayed.

    [DAS]domain1.adminServer>show-node node1
    ============================================================
    +------------------------------------------+---------------+
    |                 Property                 |     Value     |
    +------------------------------------------+---------------+
    | Node Name                                | node          |
    | Host                                     | 192.168.34.65 |
    | Mapped Servers                           |               |
    | Node Type                                | JAVA          |
    | NodeManager Port                         |          7730 |
    | Use SSL                                  | false         |
    +------------------------------------------+---------------+
    ============================================================

    To check the nodes in the domain, use the list-nodes command.

    [DAS]domain1.adminServer>list-nodes
    =========================================================================
    +-----------+------+-------------------------------------+--------------+
    | Node name | Type |            Under control            | JEUS version |
    +-----------+------+-------------------------------------+--------------+
    | node1     | JAVA | N                                   | -            |
    +-----------+------+-------------------------------------+--------------+
    =========================================================================
  3. To modify a node, use the modify-java-node or modify-node command.

    [DAS]domain1.adminServer>modify-java-node node1 -port 7731
    The node [node1] was modified successfully. Check the results using "show-node"
    [DAS]domain1.adminServer>modify-node node1 -port 7732
    The node [node1] was modified successfully. Check the results using "show-node"
    
  4. To check the modified node information, use the show-node command.

    [DAS]domain1.adminServer>show-node node1
    ============================================================
    +------------------------------------------+---------------+
    |                 Property                 |     Value     |
    +------------------------------------------+---------------+
    | Node Name                                | node          |
    | Host                                     | 192.168.34.65 |
    | Mapped Servers                           |               |
    | Node Type                                | JAVA          |
    | NodeManager Port                         |          7732 |
    | Use SSL                                  | false         |
    +------------------------------------------+---------------+
    ============================================================

Unlike the SSH node manager, the Java node manager requires a separate starting and terminating process.

Starting the Java Node Manager

The Java node manager can be executed using a script. When executing startNodeManager under the 'JEUS_HOME/bin' folder, the node manager becomes ready to receive commands from DAS or from the console tool to control the servers.

JEUS_HOME/bin>startNodeManager
**************************************************************
  - JEUS Home         : /home/test/jeus
  - Added Java Option :
  - Java Vendor       : Sun
**************************************************************
...
[2013.05.28 13:55:32][2] [nodemanager-1] [NodeManager-0101] The node manager is
starting.
[2013.05.28 13:55:32][2] [nodemanager-1] [NodeManager-0102] Initializing the node 
manager configuration.
[2013.05.28 13:55:32][2] [nodemanager-1] [NodeManager-0108] Beginning to listen:
localhost/127.0.0.1:7730.
[2013.05.28 13:55:32][2] [nodemanager-10] [NodeManager-0109] Processing the 
request......

If the node manager is restarted after being terminated while monitoring the servers, the node manager performs preparation tasks to monitor the servers again and the following logs are generated.

JEUS_HOME/bin>startNodeManager
**************************************************************
  - JEUS Home         : /home/test/jeus
  - Added Java Option :
  - Java Vendor       : Sun
**************************************************************
...
[2013.05.28 13:59:16][2] [nodemanager-1] [NodeManager-0101] The node manager is
starting.
[2013.05.28 13:59:16][2] [nodemanager-1] [NodeManager-0102] Initializing the 
node manager configuration.
[2013.05.28 13:59:16][2] [nodemanager-1] [NodeManager-0108] Beginning to listen:
localhost/127.0.0.1:7730.
[2013.05.28 13:59:16][2] [nodemanager-1] [NodeManager-0115] Domain=[domain1], 
Server=[adminServer]
[2013.05.28 13:59:16][2] [nodemanager-10] [NodeManager-0109] Processing the 
request......
[2013.05.28 13:59:16][2] [nodemanager-1] [NodeManager-0115] Domain=[domain1], 
Server=[server1]
[2013.05.28 13:59:16][2] [nodemanager-11] [NodeManager-0137] Beginning to 
monitor the server[adminServer] in the domain[domain1].
[2013.05.28 13:59:16][2] [nodemanager-12] [NodeManager-0137] Beginning to 
monitor the server[server1] in the domain[domain1].
[2013.05.28 13:59:16][2] [nodemanager-11] [NodeManager-0145] The process is 
alive(Server=adminServer, Process ID=4856).
[2013.05.28 13:59:17][2] [nodemanager-12] [NodeManager-0145] The process is 
alive(Server=server1, Process ID=5376).

Note

When the node manager is started, DAS may also be started. When the domain is configured and the node manager is about to run for the first time, the DAS startup option enables DAS to start on the node.

Available options can be checked using the command, startNodeManager -h.

Terminating the Java Node Manager

The Java node manager can be terminated using a script or the console tool.

The Java node manager controls the servers. This section describes how to control the servers using WebAdmin and the console tool.

Using WebAdmin

When starting a server in WebAdmin, DAS accesses the node manager of the machine and sends the server start command, and the node manager starts the server.

  1. When [Servers] is selected from the main page of WebAdmin, the server list is displayed.

  2. When [start] of the server is clicked (server1), the startup options of the server can be configured from the Start Server page. Configure the options, and click [OK] to start the server.

  3. On the upper part of the Servers page, a successful server startup message appears. In the server list, the server state is changed to RUNNING.

Using the Console Tool

The console tool can be used to access the node manager to start/terminate a server and to check the server state.

The console tool and node manager must be connected in order to control a server using the console tool. After completing the necessary tasks, terminate the connection.

The node manager logs are stored in the 'JeusNodeManager.log' file under the 'JEUS_HOME/nodemanager/logs' folder. The node manager records the log messages that are generated during server startup and monitoring. It also records the booting log messages, which are generated during server startup.

To set the log level of the node manager, configure the following setting in the node manager startup script.

-Djeus.nodemanager.log.level=FINEST

For more information about logs and log levels, refer to JEUS Server Guide. "Chapter 8. Logging".