Hitachi

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


9.3 Replacing applications

You can replace the applications running on Application Server to add functionality or correct a defect. To replace an application, stop the Application Servers that are running, undeploy the application to be replaced by using the undeploy subcommand of the asadmin utility, and then deploy the updated application by using the deploy subcommand of the asadmin utility. If a hardware load balancer is in used, then block it first.

Prerequisites

Intended users

Procedure

  1. If you are using a hardware load balancer, then block it.

    For more information about blocking, refer to the hardware load balancer manual.

  2. To display a list of performance tracers, run the list-prfs subcommand of the asadmin utility command.

    asadmin list-prfs

    When this command is run, the result is displayed as follows. Ensure that the statuses of the performance tracers are not running.

    performance_tracer_name not running
    Command list-prfs executed successfully.
  3. To display a list of server instances, run the list-instances subcommand of the asadmin utility command with the --long option specified.

    asadmin list-instances --long=true

    When this command is run, the result is displayed as follows. Ensure that the statuses of the server instances are not running.

    server_instance_name host_name port_number process_ID cluster_name not running
    Command list-instances executed successfully.
    
    • cluster_name is displayed only for cluster configurations that contain multiple Java EE servers.

  4. To display a list of web servers, run the list-webservers subcommand of the asadmin utility command.

    asadmin list-webservers

    When this command is run, the result is displayed as follows. Ensure that the statuses of the web servers are not running.

    web_server_name not running
    Command list-webservers executed successfully.
  5. To display a list of web servers, run the list-webservers subcommand of the asadmin utility command.

    asadmin list-webservers

    When this command is run, the result is displayed as follows. Ensure that the statuses of the web servers are not running.

    web_server_name not running
    Command list-webservers executed successfully.
  6. To display a list of the applications that have been deployed in order to check application names, run the list-applications subcommand of the asadmin utility command by specifying the server instance or cluster.

    asadmin list-applications --long=true server_instance_name_or_cluster_name
    • In a configuration where only one Java EE server is deployed, specify the server instance name for server_instance_name_or_cluster_name.

    • In a cluster configuration where more than one Java EE server is deployed, specify the cluster name for server_instance_name_or_cluster_name.

    When this command is run, the result is displayed as follows. Verify the application name in the list.

    NAME                     TYPE                STATUS
    application_name    <ear, web, ejb>     enabled
    application_name    <ear, web, ejb>     enabled
    Command list-application executed successfully.
  7. To undeploy applications you want to replace, run the undeploy subcommand of the asadmin utility command by specifying the application names checked in Step 6 and the server instance or cluster.

    asadmin undeploy --target server_instance_name_or_cluster_name application_name
    • In a configuration where only one Java EE server is deployed, specify the server instance name for the --target option.

    • In a cluster configuration where more than one Java EE server is deployed, specify the cluster name for the --target option.

    When this command is run, the result is displayed as follows. Ensure that the applications to be replaced were undeployed successfully.

    Command undeploy executed successfully.
  8. Repeat step 7 for all applications to be replaced.

  9. To deploy replaced applications to the server instance, run the deploy subcommand of the asadmin utility command by specifying the server instance or cluster.

    asadmin deploy --target server_instance_name_or_cluster_name file_path_of_application
    • In a configuration where only one Java EE server is deployed, specify the server instance name for the --target option.

    • In a cluster configuration where more than one Java EE server is deployed, specify the cluster name for the --target option.

    When this command is run, the result is displayed as follows. Ensure that the application was successfully deployed.

    Application deployed with name application_name. 
    Command deploy executed successfully.
  10. Repeat step 9 for all updated applications to be replaced.

    Reference note

    In steps 6 to 10, you are replacing applications by undeploying and then deploying the applications. Alternatively, you can replace applications by redeploying applications.

  11. Replace the static content stored in the docroot directory in the lower layer of the domain directory with the new content.

  12. Replace the static content stored in the document root directory of the web server (installation_directory_for_Application_Server/javaee/glassfish/nodes/node_name/web_server_name/root/htdocs) with the new content.

  13. To display a list of performance tracers, run the list-prfs subcommand of the asadmin utility command.

    asadmin list-prfs

    When this command is run, the result is displayed as follows. Ensure that the statuses of the performance tracers are running.

    performance_tracer_name running
    Command list-prfs executed successfully.
  14. To display a list of server instances, run the list-instances subcommand of the asadmin utility command with the --long option specified.

    asadmin list-instances --long=true

    When this command is run, the result is displayed as follows. Ensure that the statuses of the server instances are running.

    server_instance_name host_name port_number process_ID cluster_name running
    Command list-instances executed successfully.
    
    • cluster_name is displayed only for cluster configurations that contain multiple Java EE servers.

  15. To display a list of web servers, run the list-webservers subcommand of the asadmin utility command.

    asadmin list-webservers

    When this command is run, the result is displayed as follows. Ensure that the statuses of the web servers are running.

    web_server_name   running
    Command list-webservers executed successfully.
  16. To display a list of web servers, run the list-webservers subcommand of the asadmin utility command.

    asadmin list-webservers

    When this command is run, the result is displayed as follows. Ensure that the statuses of the web servers are running.

    web_server_name   running
    Command list-webservers executed successfully.
  17. To display a list of applications that have been deployed in the cluster in order to check the state of the replaced applications, run the list-applications subcommand of the asadmin utility command by specifying the server instance or cluster.

    To display whether an application is enabled, run the list-applications subcommand by specifying the --long option.

    asadmin list-applications --long=true server_instance_name_or_cluster_name
    • In a configuration where only one Java EE server is deployed, specify the server instance name for server_instance_name_or_cluster_name.

    • In a cluster configuration where more than one Java EE server is deployed, specify the cluster name for server_instance_name_or_cluster_name.

    When this command is run, the result is displayed as follows. The name of the application is displayed in NAME, and the type of application is displayed in TYPE. Verify that the statuses of all the applications are enabled.

    NAME                    TYPE         STATUS
    application_name   <ear, web>   enabled
    application_name   <web>        enabled
    Command list-applications executed successfully.
  18. If you are using a hardware load balancer, unblock it so that the applications can be accessed from outside the server.

    For more information about unblocking, refer to the hardware load balancer manual.