Table of Contents
This chapter describes how to configure the SSH node manager.
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.
This chapter uses remote nodes and remote servers to distinguish between remote and local (DAS machine) configurations.
Some requirements must be met in order to use the SSH node manager,
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.
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 test@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.6.0_30' export PATH='/home/java/jdk/jdk1.6.0_30/bin':$PATH # If not running interactively, don't do anything [ -z "$PS1" ] && return ...
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 test@192.168.23.129 java -version java version "1.6.0_30" Java(TM) SE Runtime Environment (build 1.6.0_30-b12) Java HotSpot(TM) Server VM (build 20.5-b03, mixed mode)
If the command executes successfully, then SSH is ready for use.
An SSH node can be configured and deleted by using WebAdmin and the console tool.
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.
The following shows how to configure an SSH node using WebAdmin.
All node-related settings can be configured from the [Node Configuration] menu. Select [Node Configuration] from the main page of WebAdmin.
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].
The node configuration can be changed or applied without clicking [Lock & Edit] or [Apply Changes].
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].
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.
Select the node name in the "Node Name" field to map to the server.
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.
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.
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".
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.
The following shows how to configure nodes using the console tool.
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/test/jeus -user test -privatekey /home/hong/.ssh/id_rsa
The node [node2] was successfully added.
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.
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/test/jeus |
| SSH user name | test |
| SSH private key | /home/hong/.ssh/id_rsa |
| SSH port | 22 |
+-----------------------------------+------------------------------------------+
================================================================================
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 | - |
+-----------+------+------------------------+----------------------+
====================================================================
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].
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.
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"
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/test/jeus | | SSH user name | test | | SSH private key | /home/hong/.ssh/id_rsa | | SSH port | 22 | +-----------------------------------+------------------------------------------+ ================================================================================
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 | Clus| Latest | Need to|Listen Ports| | | |Name | | ter |StartTime/Shut|Restart | | | | | | | | downTime | | | +-------+-------------+-----+-------+-----+--------------+--------+------------+ | adminS| RUNNING (481| N/A | 26441 | N/A | Wed Mar 27 | false | base-0.0.0.| |erver(*|sec) | | | |12:04:47 KST | |0:9736 | |) | | | | |2013 | | http-server| | | | | | | | |-0.0.0.0:808| | | | | | | | |8 | | | | | | | | | jms-0.0.0.0| | | | | | | | |:9741 | +-------+-------------+-----+-------+-----+--------------+--------+------------+ |server1| FAILED (73s|node2| N/A | N/A | N/A | N/A | N/A | | |ec) | | | | | | | +-------+-------------+-----+-------+-----+--------------+--------+------------+ |server2| SHUTDOWN | N/A | N/A | N/A | N/A | N/A | N/A | +-------+-------------+-----+-------+-----+--------------+--------+------------+ ================================================================================
[DAS]domain1.adminServer>server-info Information about Domain (domain1) ================================================================================ +--------+---------+-----+-------+-----+----------------+--------+-------------+ | Server | Status | Node| PID | Clus| Latest | Need to| Listen Ports| | | |Name | | ter |StartTime/Shutdo|Restart | | | | | | | | wnTime | | | +--------+---------+-----+-------+-----+----------------+--------+-------------+ | adminSe| RUNNING | N/A | 26441 | N/A | Wed Mar 27 | false | base-0.0.0.0| |rver(*) |(521 sec)| | | |12:04:47 KST | |:9736 | | | | | | |2013 | | http-server-| | | | | | | | |0.0.0.0:8088 | +--------+---------+-----+-------+-----+----------------+--------+-------------+ | server1| RUNNING |node2| 27005 | N/A | Wed Mar 27 | false | base-0.0.0.0| | |(31 sec) | | | |12:12:59 KST | |:19736 | | | | | | |2013 | | http-server-| | | | | | | | |0.0.0.0:18088| | | | | | | | |jms-0.0.0.0:1| | | | | | | | |9741 | +--------+---------+-----+-------+-----+----------------+--------+-------------+ | server2| SHUTDOWN| N/A | N/A | N/A | N/A | N/A | N/A | +--------+---------+-----+-------+-----+----------------+--------+-------------+ ================================================================================
For more information about the commands that are used in this section, refer to JEUS Reference Book. "4.2.3. Server Management Commands", JEUS Reference Book. "4.2.4. Domain Configuration Commands", JEUS Reference Book. "4.2.14. Node Management Commands".
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".
An SSH node can be modified using WebAdmin or the console tool.
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"
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 | /Users/kimsuok/Documents/jeus/jeus7/jeus7-b100-SNAPSHOT|
| SSH User Name | shoky |
| SSH Private Key | C:\Users\kimsuok\.ssh\id_rsa |
| SSH Port | 23 |
+---------------------+--------------------------------------------------------+
================================================================================