Hitachi

Hitachi Application Server V10 User's Guide (For UNIX® Systems)


8.11 Scaling out the system

You can scale out a system by adding Application Server to a new computer (new server) when an increase in work load is required or to make preparations for an expected increase in work load. To scale out a system, install Application Server on the new server, specify settings to connect the localhost of the new server to the remote hosts of the existing servers, and then set up Application Server.

Prerequisites

Intended users

Procedure

  1. Install Application Server on the new server.

  2. To resolve the host name of the domain administration server (localhost), edit the hosts file on the remote host.

  3. Create a password file on the localhost.

    AS_ADMIN_SSHPASSWORD=remote_host_password
  4. To create an encryption key (SSL key), run the setup-ssh subcommand of the asadmin utility command on the localhost.

    asadmin --passwordfile path_of_password_file setup-ssh
    --sshuser SSH_user_name_of_remote_host remote_host_name

    When this command is run, the result is displayed as follows:

    Command setup-ssh executed successfully.
  5. To set an alias for the password, run the create-password-alias subcommand of the asadmin utility command on the localhost.

    asadmin create-password-alias password_alias_name

    If a password is required, enter the password of the remote host.

    When this command is run, the result is displayed as follows:

    Command create-password-alias executed successfully.
  6. Edit the password file that you created in step 3.

    AS_ADMIN_SSHPASSWORD=${ALIAS=password_alias_name}
  7. Restart the domain administration server.

    asadmin restart-domain

    When this command is run, the result is displayed as follows:

    Command restart-domain executed successfully.
  8. To setup Application Server on the new server, run the create-node-ssh subcommand of the asadmin utility command to add a node on the remote host.

    asadmin --user user_name_of_domain_administration_server
    --passwordfile password_file_path 
    create-node-ssh --nodehost remote_host_name 
    --sshuser account_name_of_remote_host --sshkeyfile ~/.ssh/id_rsa 
    --installdir installation_path_for_Application_Server/javaee_absolute_path node_name_of_remote_host

    For node_name_of_remote_host, specify a name (any name to identify the node) for the node that will be added to the remote host.

    When this command is run, the result is displayed as follows:

    Command create-node-ssh executed successfully.
  9. To setup Application Server on the new server, run the create-prf subcommand of the asadmin utility command to build the performance tracer.

    asadmin create-prf --node node_name_of_remote_host performance_tracer_name

    When this command is run, the result is displayed as follows:

    Command create-prf executed successfully.
  10. To setup Application Server on the new server, run the subcommand create-instance of the asadmin utility command to build the Java EE server (server instance).

    asadmin create-instance --node node_name_of_remote_host 
    --prf performance_tracer_name 
    --cluster cluster_name server_instance_name

    Specify the name of the cluster that was built in cluster_name.

    When this command is run, the result is displayed as follows:

    Command create-instance executed successfully.
  11. When a hardware load balancer is used, run the create-webserver subcommand of the asadmin utility command to build a web server on the new server.

    Run the operations mentioned in step 15 when a software load balancer is used.

    asadmin create-webserver --node node_name_of_remote_host web_server_name

    When this command is run, the result is displayed as follows:

    Command create-webserver executed successfully.
  12. When a hardware load balancer is used, run the subcommand create-relation of the asadmin utility command and set the dependency relations in the new server.

    asadmin create-relation --relationtype redirect 
    --from web_server_name 
    --to server_instance_name 
    --properties property_name_of_dependency_relation=property_value_of_dependency_relation dependency_relation_name

    If you specify settings for the redirect-related relation, you must specify path and network-listener in the --properties option so that static content is processed by the web server, and requests for anything other than static content are processed by the Java EE server. The following is a specification example:

    Example:

    path=/apserver/:network-listener=http-listener-1

    For path, specify the URL path, starting with a slash (/). Do not specify a slash only (path=/). In this example, a request that does not contain apserver as the first part of the file path in the URL following the domain name (for example, http://xxxxxxxxxxx/index.html) is accessed as static content of a web server. A request containing apserver as the first part of the file path in the URL following the domain name (for example, http://xxxxxxxxxxx/apserver/sample/index.jsp) is redirected to the Java EE server. In this case, the request is redirected to the URL http://yyyyyyyyyyy/sample/index.jsp on the Java EE server.

    For network-listener, specify the network listener name of an HTTP or HTTPS listener on the Java EE server at the redirection destination. On the Java EE server, the default HTTP and HTTPS listeners are defined as http-listener-1 and http-listener-2, respectively, both of which are network listeners.

    When this command is run, the result is displayed as follows:

    Command create-relation executed successfully.
  13. When a hardware load balancer is used and when static content are placed in the web server (for efficiency), store the static content in the document root directory of the web browser.

    The document root directory of the web server is installation_directory_for_Application_Server/javaee/glassfish/nodes/node_name/web_server_name/root/htdocs.

  14. When a hardware load balancer is used, set the distribution of requests for the hardware load balancer.

    For details on the settings to distribute requests, refer to the manual of the hardware load balancer that is being used.

  15. When a software load balancer is used, run the create-relation subcommand of the asadmin utility command to set the dependency relations in the new server.

    asadmin create-relation --relationtype redirect 
    --from web_server_name 
    --to cluster_name 
    --properties property_name_of_dependency_relation=property_value_of_dependency_relation dependency_relation_name

    If you specify settings for the redirect-related relation, you must specify path and network-listener in the --properties option so that static content is processed by the web server, and requests for anything other than static content are processed by the Java EE server. The following is a specification example:

    Example:

    path=/apserver/:network-listener=http-listener-1

    For path, specify the URL path, starting with a slash (/). Do not specify a slash only (path=/). In this example, a request that does not contain apserver as the first part of the file path in the URL following the domain name (for example, http://xxxxxxxxxxx/index.html) is accessed as static content of a web server. A request containing apserver as the first part of the file path in the URL following the domain name (for example, http://xxxxxxxxxxx/apserver/sample/index.jsp) is redirected to the Java EE server. In this case, the request is redirected to the URL http://yyyyyyyyyyy/sample/index.jsp on the Java EE server.

    For network-listener, specify the network listener name of an HTTP or HTTPS listener on the Java EE server at the redirection destination. On the Java EE server, the default HTTP and HTTPS listeners are defined as http-listener-1 and http-listener-2, respectively, both of which are network listeners.

    When this command is run, the result is displayed as follows:

    Command create-relation executed successfully.