Chapter 3. SSH Node Manager

Table of Contents

3.1. Overview
3.2. Configuration Environment
3.2.1. Configuring SSH
3.3. Configuring and Deleting Nodes
3.3.1. Configuring an SSH Node
3.3.2. Modifying an SSH Node
3.3.3. Deleting an SSH Node

This chapter describes how to configure the SSH node manager.

3.1. Overview

The SSH node manager can run on a UNIX or UNIX-like operating system by executing the SSH (Secure Shell) commands on the node. It provides easy installation of JEUS server on the node, and DAS can execute the SSH server to configure a local node.

Windows, however, does not support the SSH node manager.

Note

This chapter uses remote nodes and remote servers to distinguish between remote and local (DAS machine) configurations.

3.2. Configuration Environment

Some requirements must be met in order to use the SSH node manager,

3.2.1. Configuring SSH

To use the SSH node manager functions on a UNIX or UNIX-like operating system, the DAS machine must be able to connect to a node via SSH. In other words, the DAS machine functions as the SSH client and the remote node functions as the SSH server.

This section does not describe how to start the SSH server, but it only describes the settings that are required for connecting to a node via SSH.

[Figure 3.1] Connecting to a Remote Node via SSH

Connecting to a Remote Node via SSH

The private key is required to connect to a Remote Node via SSH. For this, the DAS machine uses ssh-keygen to create a public and private key pair. Since JEUS does not support the passphrase, do not set the passphrase when generating the keys.

The created public and private key pair is stored as the "id_rsa" and "id_rsa.pub" files under the 'USER_HOME/.ssh' directory. If the contents of the public key's "id_rsa.pub" file are added to the 'USER_HOME/.ssh/authorized_keys' file on the remote node, then the private key can be used to connect to the remote machine.

To check if it is possible to connect to a remote node via SSH using the private key, run the following SSH command.

ssh <ssh-user-name>@<remote-host-address>

The following is an example of the SSH command.

$ ssh jeus@192.168.23.129

To start a remote server using the SSH command, the environment variable, JAVA_HOME, must be configured on the node. Since the environment variables configured in the 'USER_HOME/.bashrc' file on the remote machine are used when executing the SSH command, configure the .bashrc file as in the following example.

By default, the SSH commands are executed in a non-interactive mode in JEUS. Since the configured environment variables might not work properly in the non-interactive mode, they must be configured at the root level as in the following example.

# ~/.bashrc

export JAVA_HOME='/home/java/jdk/jdk1.7.0_80'
export PATH='/home/java/jdk/jdk1.7.0_80/bin':$PATH

# If not running interactively, don't do anything
[ -z "$PS1" ] && returnssh
...    

In the Korn shell, configure the previous settings in the USER_HOME/.kshrc file. Then, create the file, 'USER_HOME/.ssh/environment', and add 'ENV=~/.kshrc' to the file.

$ cat ~/.ssh/environment
ENV=~/.kshrc

For the previous configuration to work properly, set PermitUserEnvironment setting in the '/etc/ssh/sshd_config' file to 'yes', and then restart SSHD.

Configure the JAVA_HOME environment variable on the remote node and check if the configuration has been applied successfully by executing the following command on the DAS machine.

$ ssh jeus@192.168.23.129 java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)      

If the command executes successfully, then SSH is ready for use.

3.3. Configuring and Deleting Nodes

An SSH node can be configured and deleted by using WebAdmin and the console tool.

3.3.1. Configuring an SSH Node

After the SSH configuration is complete, the node configuration must be applied to JEUS.

A node requires the following basic information. Configure the required settings according to the node type.

  • Node name that is used as the ID

  • Address of the remote machine

  • JEUS installation directory of the remote machine

The SSH node manager can be supported in UNIX environments. The port number, user name, and the path to the private key file must be configured to access SSH.

This section describes how to configure the SSH node manager in JEUS using WebAdmin and the console tool.

Using WebAdmin

The following shows how to configure an SSH 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. The list of existing nodes is displayed on the Nodes page. The list contains the nodes that were automatically created when the JEUS instance was installed even if the user did not add any nodes. The list shows the node name, type, whether the node can be controlled, and JEUS version.

    To add a node, click [Add].

    Note

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

  3. On the Nodes page, enter the node name, host address, and JEUS installation path. Select "Ssh" for the node type, configure the required items, and then 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.

    If JEUS is successfully installed on a remote mode, the installed JEUS version can be checked in the "JEUS version" column. If JEUS is not installed, the JEUS version will not be shown. If the node can be controlled, JEUS can be installed by clicking [install]. The node must be mapped to the server in order to start the JEUS server on the node.

  5. Select the node name in the "Node Name" field to map to the server.

    Note

    This configuration can be changed dynamically. Click [Lock & Edit] to switch to the configuration mode. After changing the configuration, click [Apply Changes] to apply changes.

  6. The servers that are mapped to the node where JEUS is installed can be checked from the [Monitoring] > [Servers] menu on the left of the screen.

    Select a server from the server list and click [start]. On the page, configure each setting and click [OK] to start the server.

    Note

    The server can be started from the [Servers] menu or the [Monitoring] > [Servers] menu. For more information about the menus, refer to "Chapter 2. Java Node Manager".

  7. If the server starts successfully on the remote node, a success message appears on the upper part of the screen, and the server's status is displayed as "RUNNING" in the "Status" column.

Using the Console Tool

The following shows how to configure nodes using the console tool.

  1. Use the add-ssh-node command to add an SSH node to JEUS.

    [DAS]domain1.adminServer>add-ssh-node node2 -host 192.168.23.129
    -dir /home/jeus/jeus8 -user jeus -privatekey /home/jeus/.ssh/id_rsa
    The node [node2] was successfully added.
  2. The check-ssh-node command can be used to check if the added SSH node is running normally. The command executes a Java command via SSH on the node. If the Java command execute successfully as in the following, it means that the added node is running successfully.

    [DAS]domain1.adminServer>check-ssh-node node2
    The Domain Administration Server can execute the "java" process via SSH. 
  3. The node configuration is stored in the file, nodes.xml, and it can be checked by using the show-node command.

    [DAS]domain1.adminServer>show-node node2
    ================================================================================
    +-----------------------------------+------------------------------------------+
    |              Property             |                   Value                  |
    +-----------------------------------+------------------------------------------+
    | Node name                         | node2                                    |
    | Host                              | 192.168.23.129                           |
    | Mapped servers                    |                                          |
    | Node Type                         | SSH                                      |
    | Installed directory               | /home/jeus/jeus8                         |
    | SSH user name                     | jeus                                     |
    | SSH private key                   | /home/jeus/.ssh/id_rsa                   |
    | SSH port                          |                                       22 |
    +-----------------------------------+------------------------------------------+
    ================================================================================
  4. The node type, whether the node can be controlled, and the JEUS version can be checked by using the list-nodes command.

    [DAS]domain1.adminServer>list-nodes
    ====================================================================
    +-----------+------+------------------------+----------------------+
    | Node name | Type |      Under control     |     JEUS version     |
    +-----------+------+------------------------+----------------------+
    | node1     | JAVA | N                      | -                    |
    | node2     | SSH  | Y                      | JEUS 8               |
    +-----------+------+------------------------+----------------------+
    ====================================================================

    If the node is configured as in the previous example, the install-jeus command can be used in the console tool to install JEUS on the node.

    [DAS]domain1.adminServer>install-jeus node2
    JEUS was successfully installed on the node [node2].

    Note

    Since the install-jeus command copies the file from the DAS machine, the node must have the same OS as the DAS machine. If the OS is different, the node cannot operate normally because the native libraries cannot be used. Note that depending on the environment, the execution times can be prolonged.

  5. The configured node must be mapped to the server for it to operate on the node. Use the modify-server command, with the -node option to create the mapping.

    The following example shows how to map a server to a node.

    [DAS]domain1.adminServer>modify-server server1 -node node2
                Successfully performed the MODIFY operation for server (server1).
                Check the results using "list-servers server1 or modify-server
                server1"
  6. The show-node command can be used to check the node to see if the server is mapped.

    [DAS]domain1.adminServer>show-node node2
    ================================================================================
    +-----------------------------------+------------------------------------------+
    |              Property             |                   Value                  |
    +-----------------------------------+------------------------------------------+
    | Node name                         | node2                                    |
    | Host                              | 192.168.23.129                           |
    | Mapped servers                    | server1                                  |
    | Node Type                         | SSH                                      |
    | Installed directory               | /home/jeus/jeus8                         |
    | SSH user name                     | jeus                                     |
    | SSH private key                   | /home/jeus/.ssh/id_rsa                   |
    | SSH port                          |                                       22 |
    +-----------------------------------+------------------------------------------+
    ================================================================================
  7. The server mapped to the node can be started or terminated by using the start-server command in the console tool, and all settings required to start the server are configured automatically.

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

    If the server is terminated by the kill command on the node, DAS detects that the server state has changed to "FAILURE" and automatically restarts the server.

    The server-info command can be used to check the changes of the server state.

    [DAS]domain1.adminServer>server-info
    Information about Domain (domain1)
    ================================================================================
    +-------+---------+-----+-----+-----+------------+--------+-----------+--------+
    | Server|  Status |Node | PID | Clu |   Latest   |  Need  |   Listen  |Running |
    |       |         |Name |     |ster | Start Time |   to   |   Ports   |Engines |
    |       |         |     |     |     | / Shutdown |Restart |           |        |
    |       |         |     |     |     |    Time    |        |           |        |
    +-------+---------+-----+-----+-----+------------+--------+-----------+--------+
    | admin | RUNNING | N/A | 104 | N/A | 2016-08-23 | false  | base-0.0. | jms,   |
    |Server |(00:11:1 |     |36   |     | (Tue) pm   |        |0.0:9736   |ejb, web|
    |(*)    |7)       |     |     |     |12:44:00 KST|        | http-serv |        |
    |       |         |     |     |     |            |        |er-0.0.0.0 |        |
    |       |         |     |     |     |            |        |:8088      |        |
    |       |         |     |     |     |            |        | jms-0.0.0 |        |
    |       |         |     |     |     |            |        |.0:9741    |        |
    +-------+---------+-----+-----+-----+------------+--------+-----------+--------+
    | serve | FAILED( | nod | N/A | N/A | N/A        | N/A    | N/A       | N/A    |
    |r1     |00:02:33)|e2   |     |     |            |        |           |        |
    +-------+---------+-----+-----+-----+------------+--------+-----------+--------+
    | serve | SHUTDOWN| N/A | N/A | N/A | N/A        | N/A    | N/A       | N/A    |
    |r2     |         |     |     |     |            |        |           |        |
    +-------+---------+-----+-----+-----+------------+--------+-----------+--------+
    ================================================================================
    [DAS]domain1.adminServer>server-info
    Information about Domain (domain1)
    ================================================================================
    +-------+---------+-----+-----+-----+------------+--------+-----------+--------+
    | Server|  Status |Node | PID | Clu |   Latest   |  Need  |   Listen  |Running |
    |       |         |Name |     |ster | Start Time |   to   |   Ports   |Engines |
    |       |         |     |     |     | / Shutdown |Restart |           |        |
    |       |         |     |     |     |    Time    |        |           |        |
    +-------+---------+-----+-----+-----+------------+--------+-----------+--------+
    | admin | RUNNING | N/A | 104 | N/A | 2016-08-23 | false  | base-0.0. | jms,   |
    |Server |(00:14:4 |     |36   |     | (Tue) pm   |        |0.0:9736   |ejb, web|
    |(*)    |8)       |     |     |     |12:44:00 KST|        | http-serv |        |
    |       |         |     |     |     |            |        |er-0.0.0.0 |        |
    |       |         |     |     |     |            |        |:8088      |        |
    |       |         |     |     |     |            |        | jms-0.0.0 |        |
    |       |         |     |     |     |            |        |.0:9741    |        |
    +-------+---------+-----+-----+-----+------------+--------+-----------+--------+
    | serve | RUNNING | nod | 6516| N/A | 2016-08-23 | false  | BASE-0.0. | jms,   |
    |r1     |(00:00:1 |e2   |     |     | (Tue) pm   |        |0.0:9836   |ejb, web|
    |       |2)       |     |     |     |12:58:36 KST|        |           |        |
    +-------+---------+-----+-----+-----+------------+--------+-----------+--------+
    | serve | SHUTDOWN| N/A | N/A | N/A | N/A        | N/A    | N/A       | N/A    |
    |r2     |         |     |     |     |            |        |           |        |
    +-------+---------+-----+-----+-----+------------+--------+-----------+--------+
    ================================================================================

3.3.2. Modifying an SSH Node

An SSH node can be modified using WebAdmin or the console tool.

  1. A node can be modified using the modify-ssh-node or modify-node command.

    [DAS]domain1.adminServer>modify-ssh-node node2 -host
                  192.168.23.128 The node [node2] was modified successfully. Check
                  the results using "show-node"
                  [DAS]domain1.adminServer>modify-node node2 -host 192.168.23.127
                  The node [node2] was modified successfully. Check the results
                  using "show-node"
  2. To check the modified node, use the show-node command.

    [DAS]domain1.adminServer>show-node node2
    ================================================================================
    +---------------------+--------------------------------------------------------+
    |       Property      |                          Value                         |
    +---------------------+--------------------------------------------------------+
    | Node Name           | node2                                                  |
    | Host                | 192.168.23.127                                         |
    | Mapped Servers      | server2                                                |
    | Node Type           | SSH                                                    |
    | Installed directory | /home/jeus/jeus8                                       |
    | SSH User Name       | jeus                                                   |
    | SSH Private Key     | /home/jeus/.ssh/id_rsa                                 |
    | SSH Port            |                                                     22 |
    +---------------------+--------------------------------------------------------+
    ================================================================================

3.3.3. Deleting an SSH Node

An SSH node can be deleted by using WebAdmin or the console tool. Since deleting an SSH node is same as deleting a Java node, the explanation is omitted in this section. For more information, refer to "2.4.2. Deleting a Java Node".