Sun Java Solaris Communities My SDN Account Join SDN
 
Article

Provisioning Sun Java System Application Server With N1SPS

 
By Jane Young, Prashanth Abbagani, Sreenivas Munnangi, Rajeshwar V Patil, and Rick Palkovic, November 2007  

Articles Index

This article describes the Sun N1 Service Provisioning System 6.0 (N1SPS) Plug-In available for Sun Java System Application Server 9.1 and GlassFish version 2. The plug-in also supports versions 8.1 and 8.2 of Sun Java System Application Server.

Sun Java System Application Server 9.1 features an excellent browser-based graphical user interface (GUI) known as Admin Console. Also available is a versatile command-line interface (CLI). However, these tools are often not sufficient for large-scale enterprise deployments. Sun N1 Service Provisioning System (N1SPS), with its extensible plug-in architecture, has been designed for just such deployments. The N1SPS Plug-In for Sun Java System Application Server makes it easy to install, configure, and manage application server installations across your enterprise.

Sun Java System Application Server 9.1 is the Sun-supported distribution of the open-source GlassFish v2 application server. This article henceforth uses the name Application Server to embrace all versions compatible with the N1SPS Plug-In, except when it is important to draw a distinction between them.

Contents
About Sun N1 Service Provisioning System

N1SPS eases application server provisioning, so you can quickly and easily install, configure, deploy, and manage applications within a network computing environment. For more information on the Sun N1 Service Provisioning System, see the N1 Frequently Asked Questions.

Using N1SPS in Application Server Enterprise Environment

With Application Server, you can set up enterprise-level websites with clusters of application server instances on multiple hosts. Enterprise-level sites, hosted by a data center, support critical activities such as finance, health care, retail, and auction. Such sites require high availability, load balancing, scalability, failover protection, and session persistence.

When developing for an enterprise-level site, it is common practice (as well as prudent) to set up two environments, one for development and one for production. When the development environment is stable and tested, it is replicated to the production environment. With the N1SPS Application Server Plug-In, you can easily set up these development and production environments.

Application Server Clustering Architecture

An enterprise-level Application Server installation typically uses a clustered architecture. See the article Clustering in GlassFish Version 2 for a detailed discussion of clustering. In this article, we present only some basic concepts.

The following figure shows Application Server cluster architecture from a runtime-centric viewpoint. The figure shows a single cluster composed of N instances. Every machine that hosts a server instance requires a node agent, also shown. The Domain Administration Server (DAS) that administers the cluster, instances, and node-agents is not shown in the figure.

Clustering Architecture Overview
Figure 1. Clustering Architecture Overview
 

At the top of the figure, various transports (HTTP, JMS, RMI-IIOP) are shown communicating with the clustered instances through a load balancing tier. The software-based load balancer is typically installed on a dedicated machine.

Custom resources, such as enterprise information systems, connect to the load balancer through resource adapters in the Java connector architecture. All of the transports can be load balanced across the cluster, both for scalability and for fault-tolerant strategies implemented by redundant units available upon single-point failure.

At the bottom of the figure is a High-Availability Application State Repository, an abstraction of session state storage. The repository stores session state, including HTTP session state, stateful EJB session state, and single sign-on information. This state information can be stored either by means of memory replication or by a high-availability database (HADB). As with the load balancing tier, HADB is typically installed on a dedicated machine.

An enterprise-level data center may incorporate hundreds of machines spread across many geographic locations. Managing such an environment can be very challenging. The management tools supplied with Application Server each have limitations when used in large-scale deployments. For example, the GUI requires that you log in to one Admin Console for each administrative domain, and the CLI requires you to furnish the user name, password, host name, and port number for each domain.

N1SPS to the Rescue

N1 Service Provisioning System (N1SPS) greatly simplifies Application Server deployments in enterprise environments. It enables you to deploy multi-tier applications across heterogeneous platforms from a single management console. Moreover, N1SPS is available at no cost.

To understand how N1SPS works with Application Server, you first need to know how N1SPS works.

N1SPS is a distributed software platform that includes the following special-purpose applications, which you install on the servers in your network.

  • Master Server – a central server that provides an interface for managing application deployments.
     
  • Remote Agent – a management application that performs operations on a host. Every server that you want to be controlled by the N1SPS must have the Remote Agent application.
     
  • Local Distributor – an optional server that acts as a proxy for the Master Server to optimize network communications across data centers and through firewalls.

These applications interact to enable you to deploy software to the servers in your network. The applications are supported by the following important software entities:

  • Component – a deployable object within N1SPS software. N1SPS Application Server Plug-In is supplied with several built-in components, including a Domain component and a Cluster component.
     
  • Plan – an xml file that contains a set of instructions that call the procedures defined in a component. The instructions are targeted to one or more hosts. For example, you design a single plan to deploy an application to multiple Application Server targets such as a domain, a cluster, or a standalone instance.
     
  • Variable Set – a list of attributes that become part of a plan or component during N1SPS execution. A variable set can be part of a plan or a component. The attributes in the variable set typically contain any required default values. You must provide these values in order to run the plan.

The following figure shows an overview of the N1SPS architecture.

N1SPS architecture
Figure 2. N1SPS architecture
Click here for a larger image.
 

In this architecture, you can use a single administration console or CLI to administer an enterprise-level system made up of multiple domains, node agents, clusters, and server instances, with software load balancer and HADB installed on multiple machines.

Extending N1SPS With Application Server Plug-In

Plug-ins are packaged solutions that use plans and components to extend the provisioning capability of N1SPS for a specific platform, application, or environment. N1SPS Application Server Plug-In (available at no cost) is one such solution.

To begin using the Sun Java System Application Server Plug-In, you import it to the N1SPS Master Server. The plug-in supports Sun Java System Application Server 9.1 as well as Sun Java System Application Server 8.2 (part of Java Enterprise System 5) and Sun Java System Application Server 8.1 (part of Java Enterprise System 4). The plug-in also supports GlassFish v2, but not for installing and uninstalling.

The plug-in helps you use N1SPS for the following tasks:

  • Installation of Sun Java System Application Server – using the plug-in, you can install Sun Java System Application Server versions 9.1, 8.2 EE, and 8.1 EE on different machines from one console without even logging in to the machines. You can even install on multiple machines in parallel with just one mouse click.
     
  • Domain Management – domain management is easier with N1SPS Application Server Plug-In. You do not need to log in to the machine to create, delete, start, and stop the domain. Finding the domain administration port is straightforward because the domain configuration is saved in the N1SPS Master Server variable setting.
     
  • Node Agent Management – similarly, node agent management is easier with N1SPS because you do not need to log in to the machine to create, delete, start, and stop the node agent. Because N1SPS operates on “targetable hosts,” you do not need to remember the domain user name, password and port number when creating the node agent.
     
  • Instance Management – you can create, delete, start, and stop standalone or clustered instances. Because instance configuration is saved in the N1SPS Master Server variable setting, finding the instance port numbers is easy.
     
  • Cluster Management – you can create, delete, start, and stop a cluster in a domain. You can start multiple clusters with one mouse click. You can also view the instances in the cluster.
     
  • Application Deployment – you can deploy enterprise application to multiple targets like domains, clusters, and instances. Because N1SPS enables you to create an application component, the N1SPS Master Server automatically creates version control for the application. For example, if you have an application checked in to the N1SPS Master Server and decide to make changes, you can reload the component with the modified application and N1SPS Master Server automatically performs version control for you. You can easily roll back to the older version if you wish.
     
  • Installation of Load Balancer Plug-In – no need to log in to separate machine to manage the Load Balancer plug-in. In Application Server 8.1 and 8.2, you need to manually copy the loadbalancer.xml file to the Web Server instance location. N1SPS Application Server Plug-In logs in and copies the file with one mouse click.
     
  • Installation of HADB Server and Client – installing HADB server and client is simple with N1SPS Application Server Plug-In. No need to log in to multiple machines to install HADB. You can even start and stop HADB from N1SPS Master Server.
     
  • Resource Configuration and Management – you can create and delete resources using N1SPS Application Server Plug-In. The ability to run the Application Server asadmin command-line interface enables you to accomplish almost any Application Server management task.

Note: When using N1SPS with GlassFish v2, you can use the Sun Java System Application Server Plug-In to configure and manage GlassFish v2 installations, but you cannot install or uninstall GlassFish v2.

Software Download and Installation

To download N1SPS and Application Server Plug-In 6.0 at no cost, visit the download page. Click the Get It tab, then the All Supported Platforms link.

For installation instructions, see Sun N1 Service Provisioning System 6.0 Installation Guide.

Follow the instructions provided for installing N1SPS. Below are additional tips for installing the plug-in.

Reviewing Supported Versions of Sun Java System Application Server

The following versions of Application Server are supported with Application Server plug-in version 6.0.

Application Server Version
(Package-Based Distribution)
Operating System Minimum RAM JVM Version N1SPS Version
9.1 Solaris 10 SPARC 1 GB Java SE 5, 6 6.0
Solaris 10 SPARC 1 GB Java SE 5, 6 5.2
Solaris 10 x86 1 GB Java SE 5, 6 6.0
Red Hat Linux 4.0 1 GB Java SE 5, 6 6.0
8.2 Solaris 10 SPARC 1 GB Java SE 5, 6 6.0
8.1 Solaris 10 SPARC 1 GB Java SE 5, 6 6.0
Solaris 10 SPARC 1 GB Java SE 5, 6 5.2
 

For N1SPS 6.0 system requirements, see Chapter 2 of Sun N1 Service Provisioning System 6.0 Installation Guide.

Launching the N1 Browser Interface

Most of the examples discussed in this article use the browser GUI for the Sun N1 Service Provisioning System Applications. The default location is the home page of your N1 Master Server:

http://masterserver-hostname:port (usually 8080 or 8282)
 

This article assumes that you know how to open the browser interface. If you do not, consult the documentation. Note that you can also use the N1SPS command line for the examples. Consult the N1SPS CLI Reference Manual for details.

Downloading and Installing Application Server

To use Application Server plug-in version 6.0, you must first install either GlassFish v2 Application Server or Sun Java System Application Server. Both application servers are free to download. Installation instructions are available from the download pages.

  • Download Sun Java System Application Server by navigating to the download page and downloading the package-based installer.
     
  • Sun Java System Application Server Enterprise Edition is also included in downloadable Java Enterprise System software suites. Learn more here.
Uninstalling an Existing Application Server Plug-In

If there is an existing installation of Application Server plug-in, remove it before installing the latest version. To remove an older version, use the N1SPS GUI with the following steps.

  1. On the left side of the browser interface page, click Manage Applications.
     
  2. Select the Applications node.
     
  3. In the right pane, click the Plans tab.
     
  4. Under the Plans tab, click RemoveSystemServicePlan.
     
    Selecting Applications Node and Plans Tab
    Figure 3. Selecting Applications Node and Plans Tab
    Click here for a larger image.
     
  5. To run the plan, you must create a Variable Set for the plan, as described in the following steps.
     
    1. Click the Variable Set tab in the right pane.
       
    2. Click New Variable Set. The New Variable Set wizard opens.
       
    3. Step through the wizard to create a new variable set and close the wizard.
       
    4. Click Run Plan.

  6. After the plan has run, you can remove Application Server Plug-In, as described in the following steps.
     
    1. On the left side of the page, click Manage Applications.
       
    2. In the right pane, click the Application Server check box.
       
    3. Click Delete.
       
Installing the Plug-In

Before proceeding with installation of Application Server, make sure that the N1SPS remote agents are installed. Installing the remote agents is prerequisite for the remote agents to synchronize with the plug-in. Also make sure that the remote agents run with root privileges so that they can install the application server as root.

If you haven’t already done so, download the N1SPS Application Server Plug-In 6.0 from the download page, and store the plug-in on your local file system.

Expand the downloaded zip file and install the plug-in appropriate to your platform. For example, install SUNWspssas on a Solaris machine by using pkgadd.

Use the following steps to import the Application Server Plug-In to N1SPS and prepare hosts.

  1. In the left pane, under Applications, click Manage Applications.
     
  2. Click Import in the right pane, and enter the location of the file com.sun.appserv_6.0.jar. The file is stored in the location where the plug-in is installed.
     
  3. Click Import Application to import the Application Server Plug-In.
     
  4. Prepare hosts by selecting all the remote agents under Manage Hosts in the left pane.
Sun Java System Application Server Installation

With N1SPS, you can install Sun Java System Application Server, but not GlassFish v2. You can, however, provision GlassFish v2 after you perform a markOnly installation.

You can install Sun Java System Application Server from the N1 browser interface or from the CLI.

Installing from the N1 Browser Interface

The following steps install Application Server from the N1 browser interface.

  1. Expand the tree in the left pane under Manage Applications to expose the Application Server node. Select the Installation Tasks node.
     
  2. In the right pane, click Install.
     
    Installation Tasks
    Figure 4. Installation Tasks
     

  3. Create a variable set for the component. Click New Variable Set and fill in the fields as shown in the following figure. The source image is the location of the Application Server installed binary.
     
    Variable Set
    Figure 5. Variable Set
    Click here for a larger image.
     

  4. For the value of sourceImage, use the location of Sun Java System Server installer (or installer bits). Note that the location must be accessible by the Remote Agent application. For example, /space/DL_N1SPS/01NOV07/SJSAS91IFR/installer-ifr.
     
  5. Click Save to save the variable set.
     
  6. Select the Target Host, the remote agent machine on which you want to install the Application Server.
     
  7. Click Run to install the Application Server on selected target hosts. The progress bar shows you when the installation is complete.
     
  8. Verify the installation by opening the View Activity Log, in which you can view all the executed plans.
Installing With the N1 CLI

This example of installing Application Server illustrates how to write your own plan. To create a sample plan, simply try out the scenario that you are interested in (creating a domain, for example) from the N1 GUI; you will see at the very top the generated plan identifier. A plan is generated for every operation you perform.

Note that the variable ${folderName} refers to the user-defined folder created either from the N1 GUI or the CLI. The plan looks like the following.

<?xml version="1.0" encoding="UTF-8"?>
<!-- generated by N1 SPS -->
<executionPlan xmlns='www.sun.com/SPS'
<http://www.sun.com/schema/SPS'>
name='AppServerInstall-install-appserver' version='6.0' description='Plan to invoke install procedure default for component AppServerInstall'
xmlns:xsi='www.w3.org_XMLSchema-instance'
<http://www.w3.org/2001/XMLSchema-instance'>
path='folder_name_in_Master_Server' xsi:schemaLocation='www.sun.com/schema/SPS plan.xsd'>
        <simpleSteps limitToHostSet='com.sun.appserv#SupportedHS'>
            <install blockName='default'>
                <component name='AppServerInstall' path='/com/sun/appserv'version='1.0'></component>
            </install>
        </simpleSteps>
</executionPlan>
 

After you have the plan identifier, run the following command from the CLI to check out the generated plan.

cr_cli -cmd pdb.p.co -u admin -p password -plan plan-ID
 

The output of the above command shows the actual plan in xml format. Customize the generated xml plan for your needs.

Provisioning of an Existing Installation of GlassFish v2

This example shows how to identify an existing installation of GlassFish v2 on a remote machine and manage it with the N1SPS plug-in. This capability is particularly useful because GlassFish v2 does not have a silent installer that could be used with N1SPS for remote installation. You can surmount this shortcoming either by using Sun Java System Application Server 9.1 instead of GlassFish v2 or by manually installing GlassFish v2 and then following the instructions in this example.

The N1 Master Server maintains a record of the installation state of each component in the system. If the Master Server database does not contain a record that the component was installed on the host, an attempt to manage the component with N1SPS results in an error. By performing a markOnly installation on the component, you can update the Master Server database and subsequently manage the component.

Application Server markOnly Installation

In order for the N1SPS to update its Master Server records to include a manually installed instance of Application Server, you must perform a markOnly installation of the Application Server from the N1SPS Plug-In.

  1. Expand the tree in the left pane under Manage Applications until you have expanded the Application Server node.
     
    Choosing markOnly Installation Task
    Figure 6. Choosing markOnly Installation Task
     
  2. Select Installation Tasks in the left pane, and click Install (markOnly) in the right pane. The page of run options opens.
     
  3. In the run options page, click Select Host and choose the target host (the machine on which Application Server is installed).
     
  4. In the Component Variables section of the run options page, click Edit Variable Set. The Variable Sets page opens.
     
  5. Click New Variable Set. The New Variable Set wizard opens.
     
  6. Fill in the fields for installDirectory and installDataServerConfigDirectory as shown in the following figure. You do not need to fill in the sourceImage field because the installation task is markOnly.
     
    Variable Set for markOnly Task
    Figure 7. Variable Set for markOnly Task
    Click here for a larger image.
     
  7. Click Run Plan to perform the markOnly installation of Application Server on the target hosts. The progress bar shows when the markOnly installation is complete.
     
  8. Verify the installation by opening the View Activity Log, in which you can view all the executed plans.

The N1SPS system now recognizes the Application Server installation. You can perform other tasks on it as though had been originally installed through the N1SPS Plug-In.

Domain Admin Server Infrastructure Tasks

Domain Admin Server infrastructure tasks enable you to create, create (mark only), start, stop, delete, and delete (mark only) the domain on the specified set of target hosts. It also enables you to view the list of domains installed.

Domain Admin Server Infrastructure Tasks
Figure 8. Domain Admin Server Infrastructure Tasks
 

The following examples show how to create and delete a domain.

Creating a Domain

The Domain Admin Server > Create task enables you to create a domain.

  1. Click the Create button. A page of run options opens, as shown in the following figure.
     
    Run Options for Creating a Domain
    Figure 9. Run Options for Creating a Domain
    Click here for a larger image.
     
  2. Click Select Host to choose a target host in which to create the domain. Note that the host list shows only the hosts on which Application Server is installed.
     
  3. Before you can run the Create procedure, you must create a variable set. Click Edit Variable Set in the run options page to open the Variable Set page, shown in the following figure.
     
    Variable Set for Creating a Domain
    Figure 10. Variable Set for Creating a Domain
    Click here for a larger image.
     
  4. Click New Variable Set. The New Variable Set page opens.
     
    Accept the defaults in the New Variable Set page, or change them as desired. For example, the default name of the domain is domain1, which is not always appropriate.
     
  5. Click Save to store your changes.
     
  6. After you have created a new variable set, click Run. You will see the result when the create domain plan is finished.
Deleting a Domain From the GUI

The Domain Admin Server > Delete task enables you to delete a domain.

  1. Click the Delete button to open a page like the one shown in the following figure.
     
    Selecting a Host for Deleting a Domain
    Figure 11. Selecting a Host for Deleting a Domain
     
  2. Select the domain virtual host from which to delete the domain.
     
    Run Options for Deleting a Domain
    Figure 12. Run Options for Deleting a Domain
    Click here for a larger image.
     
  3. Click Run Selected Installation. The page of run options opens, as shown in the following figure.
     
    Deleting the Domain
    Figure 13. Deleting the Domain
    Click here for a larger image.
     
  4. Click Run. After the task has completed, the GUI shows success status.
Cluster Management Tasks

Cluster infrastructure tasks enable you to create, create (mark only), start, stop, set up in-memory replication, delete, and delete (mark only) the cluster associated with an existing domain. You can also view the list of clusters. The examples in this section show how to create and delete a cluster.

Cluster Infrastructure Tasks
Figure 14. Cluster Infrastructure Tasks
 
Creating a Cluster

Use the following procedure to create a cluster.

  1. From the Infrastructure Tasks page, click Cluster > Create to create a cluster. The page of run options opens.
     
    Run Options for Creating a Cluster
    Figure 15. Run Options for Creating a Cluster
    Click here for a larger image.
     
  2. Click Select Host to open a list from which to select the target host on which to create the cluster. Note that the list contains only the virtual hosts in the domain.
     
  3. Before you can create a cluster, you must create a new variable set. From the run options page, click Edit Variable Set.
     
  4. Click New Variable Set. The New Variable Set page opens.
     
    Accept the defaults in the New Variable Set page, or change them as desired. For example, the default name of the targetName is cluster1, which is not always appropriate.

    A New Variable Set for Creating a Cluster
    Figure 16. A New Variable Set for Creating a Cluster
    Click here for a larger image.
     
  5. Click Save to store your changes.
Deleting a Cluster

The Cluster > Delete task enables you to delete a cluster.

  1. Click the Delete button to open a page like the one shown in the following figure.
     
    Selecting a Host From Which to Delete a Cluster
    Figure 17. Selecting a Host From Which to Delete a Cluster
     
  2. Select the virtual host of the cluster, which appears in the list.
     
  3. Click Run Selected Installation. A page like the one shown in the following figure opens.
     
    Deleting a Cluster
    Figure 18. Deleting a Cluster
    Click here for a larger image.
     
  4. Click Run. After the task has completed, the GUI shows success status.
Node Agent Infrastructure Tasks

Node Agent infrastructure tasks allow you to create, create (mark only), start, stop, delete, and delete (mark only) the node agent on a specified set of target hosts associated to a specific Domain Administration Server (DAS). You can also view the list of node agents installed. The examples in this section show how to create and delete a node agent.

Node Agent Infrastructure Tasks
Figure 19. Node Agent Infrastructure Tasks
 
Creating a Node Agent
  1. From the Infrastructure Tasks page, click Node Agent > Create to create a node agent. A page of run options opens.
     
    Run Options for Creating Node Agent
    Figure 20. Run Options for Creating Node Agent
    Click here for a larger image.
     
  2. Click Select Host to open a list from which to select the target host on which to create the node agent. Note that the list contains only hosts on which an Application Server is installed.
     
  3. Before you can create a node agent, you must create a new variable set. From the run options page, click Edit Variable Set.
     
  4. Click New Variable Set. The New Variable Set page opens.

  5. In the New Variable Set page, provide the virtual host name for the domain of the node agent you want to create.
     
    Accept the defaults for the other values, or change them as desired. For example, the default name of the node agent is nodeagent1, which is not always appropriate.
     
    New Variable Set for Creating Node Agent
    Figure 21. New Variable Set for Creating Node Agent
    Click here for a larger image.
     
  6. Click Save to store your changes.
     
  7. Click Run to create the node agent on the selected installation. After the task has completed, the GUI shows run status.
Deleting a Node Agent

The Node Agent > Delete task enables you to delete a node agent.

  1. Click the Delete button to open a page like the one shown in the following figure.
     
    Deleting a Node Agent
    Figure 22. Deleting a Node Agent
    Click here for a larger image.
     
  2. Select the virtual host of the node agent, which appears in the list.
     
  3. Click Run to delete the node agent on the selected installation. After the task has completed, the GUI shows run status.
Standalone and Cluster Instance Infrastructure Tasks

Standalone and Cluster Instance infrastructure tasks enable you to create, create (mark only), start, stop, delete, and delete (mark only) the instances associated with an existing node agent. You can also view the list of instances.

Standalone and Cluster Instance Infrastructure Tasks
Figure 23. Standalone and Cluster Instance Infrastructure Tasks
Click here for a larger image.
 

For cluster instances, the tasks apply to an existing cluster. The following examples show how to create and delete a cluster instance. Tasks for standalone instances are nearly the same. For example, the clusterName variable is not available for a standalone instance. Otherwise, creating a standalone instance is the same as creating a cluster instance.

Creating a Clustered Instance

The Cluster Instance > Create task enables you to create a clustered instance.

  1. From the N1 GUI, click the Cluster Instance > Create button to open a page of run options like the one shown in the following figure.
     
    Run Options for Creating a Clustered Instance
    Figure 24. Run Options for Creating a Clustered Instance
    Click here for a larger image.
     
  2. Click Select Host and choose the virtual host of the node agent where you want to create the instance. You choose the host from a list of hosts with existing node agents.
     
  3. In the run options page, click Edit Variable Set. A page like the one shown in the following figure opens.
     
    Editing Variables
    Figure 25. Editing Variables
    Click here for a larger image.
     
  4. Specify a value for the clusterName variable, the name of the cluster with which this instance will be associated. Accept the defaults for the other variables, or change them as desired. For example, you may want to change the default targetServer name from server1 to something more descriptive.
     
  5. Save your changes, then click Run to run the plan.
Deleting a Clustered Instance

The Delete Instance > Delete task enables you to delete a clustered instance.

  1. From the N1 GUI, click the Cluster Instance > Delete button.
     
  2. Click Select Host and choose the virtual host from which you want to delete the cluster instance. After you choose the host, a page like the one shown in the following figure opens.
     
    Deleting a Clustered Instance
    Figure 26. Deleting a Clustered Instance
     
  3. Click Run. The GUI displays the status of the run after it is completed.
Deploying and Undeploying an Application

In the next two examples, you deploy and undeploy an application. Before you deploy the application, you create a component to contain it. You then deploy the component using component procedures.

Deploying an Application

You deploy or undeploy a Java Enterprise Edition (Java EE) application or module by creating the deployment component for it.

Creating a Deployment Component

To deploy an application, first create a deployment component to upload the application archive to the master server repository, then use that component to deploy the application.

Creating a Folder to Hold the Component

  1. In the N1SPS GUI, click Manage Plans and Components on the left side of the page, then click the Folders tab on the right.
     
    Creating a New Folder
    Figure 27. Creating a New Folder
    Click here for a larger image.
     
  2. Click New Folder. The New Folder Wizard opens.
     
  3. In the New Folder Wizard, provide the needed information, such as Folder Name. For this example, name the folder Deploy. After the folder is created, you see it on the left in the directory tree.
Creating the Component
  1. In the left pane of the window shown in the preceding figure, click Manage Applications. Expand the tree until the Application Server node is expanded, as shown in the following figure.
     
  2. Select the Application Tasks node in the tree to display the Application Tasks pane on the right.
     
    Application Tasks
    Figure 28. Application Tasks
    Click here for a larger image.
     
  3. Click Create Application Component. The New Component Wizard page opens, as shown in the following figure.
     
  4. In the New Component Wizard, specify a component name and folder. In the figure, the component name is deploy and the folder name is /Deploy/.
     
    New Component Wizard
    Figure 29. New Component Wizard
    Click here for a larger image.
     
  5. Click Next to advance to the next step.
     
  6. Specify the file source by specifying server name and deployment application archive details.
     
  7. Advance through Steps 3 and 4 and click Finish to complete the creation of the component.

Deploying the Component

You can use one of three methods to deploy components:

  • Component procedures – For simple, single operations involving one component and one host or host set.
     
  • Generated plans – For multiple operations involving one component and one host or host set.
     
  • Custom plans – For complex operations involving multiple components and multiple hosts.
     

This example illustrates how to deploy using component procedures. The example uses the component you just created.

  1. In the N1 GUI, click Manage Plans and Components from the left navigation menu. The following figure illustrates steps 1–3.
     
    Viewing Components in a Folder
    Figure 30. Viewing Components in a Folder
    Click here for a larger image.
     
  2. In the directory tree, click the Deploy folder.
     
  3. Click the Components tab on the right side of the page and take note of the deploy component you have created.
     
  4. Click the deploy component, then click on the Variable Sets tab.
     
  5. Click New Variable Set to open the New Variable Set wizard, as shown in the following figure.
     
  6. Type a name for the new variable set and click Save. In the example, the name is hello_app.
     
    New Variable
Set Wizard
    Figure 31. New Variable Set Wizard
    Click here for a larger image.
     
  7. In the N1 browser interface page, click the Procedures tab on the right.
     
  8. Select the install:default checkbox to enable deployment of the application.
     
  9. Click Run Procedure, and specify the required host identifying information.
     
    Providing Host
Information
    Figure 32. Providing Host Information
    Click here for a larger image.
     
  10. Click Run to deploy the application.

Verifying Deployment

You can verify successful deployment by examining the Hosts table. To view the table, click the Where Installed tab.

Verifying Successful Deployment
Figure 33. Verifying Successful Deployment
Click here for a larger image.
 
Undeploying an Application

To undeploy the application that was deployed in the previous example, perform the following steps:

  1. In the N1 GUI, click Manage Plans and Components from the left navigation menu.
     
  2. Click the folder in which the deploy component is located.
     
  3. Select the component you want to undeploy.
     
  4. From the N1 GUI, click the Procedures tab.
     
  5. Check the uninstall:default box and select the application host.
     
  6. Click Run Selected Installation. A page opens showing the run option.
     
    Undeploying an Application
    Figure 34. Undeploying an Application
    Click here for a larger image.
     
  7. Click Run to undeploy the application.

Verifying Undeployment

As with deployment, you can verify successful undeployment by examining the Hosts table. To view the table, click the Where Installed tab. The pane shows that the application is no longer deployed.

Verifying Successful Undeployment
Figure 35. Verifying Successful Undeployment
Click here for a larger image.
 
Load Balancer Plug-In Infrastructure Tasks

Load Balancer Plug-In infrastructure tasks enable you to install, install (mark only), uninstall, and uninstall (mark only) the Load Balancer Plug-In for Sun Java System Web Server 6.1 and 7.0 versions. You can also view the list of Load Balancer Plug-In installations.

Load Balancer Plug-In Infrastructure Tasks
Figure 36. Load Balancer Plug-In Infrastructure Tasks
 
Installing the Load Balancer Plug-In
  1. In the N1 GUI, click Infrastructure Tasks in the left pane.
     
  2. Click Install under Load Balancer Plug-In on the right pane. A page of run options like the one shown below opens.
     
    Installing Load Balancer Plug-In
    Figure 37. Installing Load Balancer Plug-In
     
  3. Click Select Host and choose the target hosts, the machines on which you want to install the Load Balancer Plug-In.
     
  4. Click Edit Variable Set. A page is presented in which you fill in the values for the Load Balancer Plug-In source image (sourceImage), the Web Server installation directory (webserverInstall), and the Web Server instance location (webserverLocation).
     
    Variable
Set for Load Balancer Plug-In Installation
    Figure 38. Variable Set for Load Balancer Plug-In Installation
     
  5. Click Run.

The installation may take some time, depending on the speed and number of machines involved and the configuration of the network. When the plan has finished running, the browser interface displays the status of the operation. Upon successful completion, Load Balancer is ready for use.

Uninstalling the Load Balancer Plug-In

This procedure uninstalls an existing Load Balancer Plug-In.

  1. In the N1 GUI left pane, click Infrastructure Tasks.
     
  2. In the right pane, under Load Balancer Plug-In, click Uninstall. The browser displays the page shown below.
     
    Selecting Hosts for Load Balancer Plug-In
Uninstallation
    Figure 39. Selecting Hosts for Load Balancer Plug-In Uninstallation
     
  3. Select the machine locations of the Load Balancer you want to uninstall from the list of Component Installed Locations.
     
  4. Click Run Selected Installation. A page like the one shown below opens to display run options.
     
    Setting Run Options for Load Balancer Plug-In
    Figure 40. Setting Run Options for Load Balancer Plug-In Uninstallation
    Click here for a larger image.
     
  5. Click Run to uninstall the Load Balancer plug-in from the hosts you selected in step 3.
HADB Tasks

Application Server Plug-In enables you to install High Availability Database (HADB) on target hosts. The installation must be associated with an existing DAS. You can start and stop the HADB agent, and uninstall and uninstall (mark only) HADB. You can also view the list of HADBs installed.

HADB Infrastructure Tasks
Figure 41. HADB Infrastructure Tasks
 
Installing HADB

Note: When installing Sun Java System Application Server 9.1 with Interface Repository (IFR), N1SPS also installs HADB in the background. If HADB is already installed, a subsequent attempt to install HADB will cause the plug-in to perform a markOnly installation. This behavior is a feature that overcomes a bug in IFR. IFR does not support an incremental installation of the HADB component over an existing Application Server installation.

To install HADB:

  1. In the N1 GUI, click Infrastructure Tasks in the left pane.
     
  2. Under HADB in the right pane, click Install. A page opens (see below) in which you set run options for the task.
     
    Setting Run Options for Installing HADB
    Figure 42. Setting Run Options for Installing HADB
    Click here for a larger image.
     
  3. Click Select Host and choose the target hosts, the machine(s) on which you want to install HADB.
     
  4. Click Edit Variable Set. You will see a dialog box in which to fill in the value for the location of the HADB instance you have downloaded (sourceImage). You must also enter the Domain's virtual host name (dasVirtualHostName; for example, mymachine-AppServer-1_domain_domain1).
     
    Variable Set for HADB Installation
    Figure 43. Variable Set for HADB Installation
    Click here for a larger image.
     
  5. Click Save to store your work.
     
  6. In the page of run options, click Run to install HADB.

The installation may take some time, depending on the speed and number of machines involved and the configuration of the network. When the plan has finished running, the browser interface displays the status of the operation. Upon successful completion, the HADB is ready for use.

Uninstalling HADB

To uninstall HADB:

  1. Click Infrastructure Tasks in the left pane.
     
  2. Under HADB in the right pane, select Uninstall. You will see a page like the one shown below.
     
    Identifying an HADB to Uninstall
    Figure 44. Identifying an HADB to Uninstall
     
  3. Select the HADB installation that you want to uninstall and click Run Selected Installation. The browser interface shows a page like the one shown below in which you set run options.
     
    Run Options for HADB Uninstallation
    Figure 45. Run Options for HADB Uninstallation
    Click here for a larger image.
     
  4. Click Run to uninstall the HADB from the selected hosts.
Generic asadmin Component

Sun Java System Application Server (SJSAS) Plug-In 6.0 for N1SPS enables you to run generic asadmin commands in remote and local modes. The plug-in supplies components and plans to meet most common requirements. However, you may want to use a form of asadmin that is not provided through the available plans and components. In these cases, you can use the generic asadmin command component to meet your needs.

The asadmin component comes in two flavors, remote and local:

  • In remote use, the asadmin commands are communicated through the http(s) protocol to the DAS. In the remote case, you must specify to the component the command name and arguments; the user ID, password, host name, and port are furnished automatically by N1SPS.
     
  • In local use, the asadmin command does not require the user id and password, so N1SPS provides no values to the local command.

To save remote or local commands to use later, use the Create Component tasks.

The following figure shows N1SPS Admin Console support for asadmin commands. To view the tasks, select the node Manage Applications > Applications > Application Server > Other Tasks in the left pane.

N1SPS Admin Console Support for asadmin Commands
Figure 46. N1SPS Admin Console Support for asadmin Commands
Click here for a larger image.
 

The tasks are:

  • Remote Command – This procedure executes an asadmin remote command on multiple domains as the targetable host. The required variable is asadminCommand. The variable asadminArguments is optional.
     
  • Create Remote asadmin Component – This procedure opens a wizard in which you create a custom component from the generic asadmin remote component. You can name the component so it can be easily identified as the asadmin command and can be tracked in the Activity Log. You can overwrite the variables asadminCommand and asadminArguments. When executing the custom component, you are not required to create a variable set because the default values are the ones that are required for the command execution.
     
  • Local Command – This procedure is similar to the Remote Command except that the asadmin command is executed locally. The targetable host is the AppServer Install virtual host name.
     
  • Create Local asadmin Component – This procedure is similar to Create Remote asadmin Component, except that the custom component created is for executing the asadmin command locally.

The following procedures show how to use the asadmin component's remote command to configure one of the Application Server's JVM options.

Configuring Application Server With the asadmin Component

Typically, you configure Application Server with the predefined components under the Configuration Tasks Node of the Application Server Plug-In Navigation Menu. You can also configure the Application Server with the generic asadmin component under Other Tasks. This example explains how to use the generic asadmin component for configuring Application Server.

The following steps configure maximum heap size. Procedures for configuring other options are similar.

  1. Determine the current value corresponding to maximum heap size JVM Options using the Admin Console.
     
    JVM Options
    Figure 47. JVM Options
    Click here for a larger image.
     
    From the previous figure, you can see that the current value is -Xmx512m. You will increase this value to 1024m (1 GB).
     
  2. Delete the existing JVM option. The equivalent asadmin command for deleting the JVM option is asadmin delete-jvm-options -- -Xmx512m. In this step, you set the option in the Admin Console.
     
    1. Select Other Tasks under the Application Server node on the left, and click Remote Command in the right pane.
       
      Selecting Remote Command
      Figure 48. Selecting Remote Command
      Click here for a larger image.
       
    2. A page opens (see below) in which you set run options for the task. Click Select Host and specify values for Target Host.
       
      Run Options for Remote Command
      Figure 49. Run Options for Remote Command
      Click here for a larger image.
       
    3. Click Edit Variable Set, then New Variable Set. Define a new variable set called delete_heap_512m.
       
      New Variable Set for Deleting Heap Option
      Figure 50. New Variable Set for Deleting Heap Option
       
    4. Click Save, then Run in the main page.
       
  3. Create a new JVM option. The equivalent asadmin command for creating the JVM option is
    asadmin create-jvm-options -- -Xmx1024m. In this step, you set the option in the Admin Console.
     
    1. Select Other Tasks under the Application Server node on the left, and click Remote Command in the right pane.
       
    2. Click Select Host and provide values for Target Host.
       
    3. Click Edit Variable Set, then New Variable Set. Define a new variable set called create_heap_1024m.
       
      New Variable Set for Creating Heap Option
      Figure 51. New Variable Set for Creating Heap Option
       
    4. Click Save, then Run in the main page.
       
  4. Confirm that the value for maximum heap size in JVM Options is correct by selecting JVM Settings in the Admin Console. Note that the value shown in the following figure is now -Xmx1024m.
     
    Verifying New Variable Value
    Figure 52. Verifying New Variable Value
     
N1SPS and Application Server Audit Trails

One of the benefit of using N1SPS with Application Server Plug-In to administer Application Server is that all actions and changes made by administrators are logged and recorded. This feature is often called audit trail. This section explains how to maintain and use audit trails.

In the N1SPS GUI left pane, you see the View Activity Log menu item, as shown in the following figure.

View Activity Log Menu
Figure 53. View Activity Log Menu
 

To view the activity log, click Run History in the left pane. The right pane shows all the activities recorded.

Viewing Run History
Figure 54. Viewing Run History
Click here for a larger image.
 
  • Column 2 of the Run History page is the plan name. The plan name tells you what action the plan is intended to perform. The N1 Master Server appends a unique ID.
     
  • Column 5 indicates where the action has taken place by identifying the target hosts.
     
  • Column 6 identifies the user who executed the plan.
     
  • Column 7 shows the success status of the execution.
     
  • Columns 8 and 9 display the start and end times of the action.

Examining the first plan shown in the figure, you see that the plan name is DomainAdminServer-inst-create-unique ID. The name of the plan tells you that its action creates an install domain. A markOnly install action is identified by the name DomainAdminServer-markOnly-create-unique ID.

In the Target Hosts column, you see that the domain was created on the host z19-AppServer-1, where z19 is the physical host name and AppServer-1 is the Application Server installation ID.

Column 6 shows that the user who created the domain was logged in as admin. The remaining columns show that the domain creation was a success and that the creation occurred on 10/10/2007 between 4:31 and 4:33 PM.

By clicking the plan name link in column 2, you can see more details of the plan, including the domain name and port numbers. You can also view the error logs and run results for preflight and deployment execution. These logs are useful for troubleshooting failed executions, as described in the next section.

Troubleshooting Application Server Plug-In

Troubleshooting failures in Sun Java System Application Server Plug-In is not difficult. The key is in knowing where to look for information about failures. In this section you will see how to look for the cause of failures in the two types of execution provided by the plug-in: preflight and deployment.

  • Preflight execution simulates the deployment plan execution. A deployment execution is always preceded by a preflight, but you can execute a plan as preflight only. The preflight execution reveals failure conditions due to unprepared hosts, invalid variables, and so on.
     
  • Deployment execution runs the component's install, uninstall, and control procedures.
Troubleshooting Preflight Failure

The following figure shows the result of a preflight failure. Note the message that reads appName cannot be null. The variable appName must be assigned a value but has not been given one. Correcting the error in this case is obvious, but it can be used as an example of how to use N1SPS troubleshooting tools.

Missing appName Failure
Figure 55. Missing appName Failure
Click here for a larger image.
 

For a detailed view of errors, click the Error Log tab. Error Log lists the hosts and steps that failed during the preflight and deployment phases of the plan. For each host, you can view more information by clicking Step Failed. In the following figure, the Context column explains that the failure occurred in preflight.

Error Log
Figure 56. Error Log
Click here for a larger image.
 

The Run Results tab, shown in the following figure, provides step-by-step execution details.

Run Results Tab
Figure 57. Run Results
Click here for a larger image.
 

From the run results, you can easily see that the failure occurred in preflight. The failure started in the lock host step. Click the lock host link to display step status, as shown in the following figure.

Step Status
Figure 58. Step Status
 

To view an execution summary, click View in the Sub Steps Status column. A window opens displaying the Sub Steps Execution Summary for the lock host step, as shown in the following figure.

Sub Steps Execution Summary
Figure 59. Sub Steps Execution Summary
Click here for a larger image.
 

From the Sub Steps Execution Summary, you can view the exact component execution. The failure started in the control service named validate. This procedure checks for the variable appName and, if it is null, raises an error.

Troubleshooting Deployment Failure

N1SPS tools can also isolate deployment failures. In this example, an attempt was made to start a standalone instance, resulting in a plan execution failure with the message: Error: unable to start instance, as shown in the following figure.

Deployment Failure
Figure 60. Deployment Failure
Click here for a larger image.
 

By clicking the Error Log tab, shown in the following figure, you can see in the Context column that the failure occurred in the context of plan execution, that is, during deployment.

Deployment Error Log
Figure 61. Deployment Error Log
Click here for a larger image.
 

The link in the Step Failed column affords little information about the source of the failure. As an alternative, click the Run Results tab to get a detailed stepwise summary, shown in the following figure.

Deployment Run Results
Figure 62. Deployment Run Results
Click here for a larger image.
 

In the Run Results tab, the Failed column indicates that the failure occurred in deployment execution. The failure was in the control service named start.

In the Deployment stepwise execution summary table, click the control server: 'start' link in the Step Name column. The Step Status page opens with more information, as shown in the following figure.

Deployment Step Status
Figure 63. Deployment Step Status
 

To view more details, click the View link in the Sub Steps Status column. A window like the one shown in the following figure opens, revealing detailed information about component execution.

Sub Steps Execution Summary
Figure 64. Sub Steps Execution Summary
Click here for a larger image.
 

The Sub Steps Execution Summary table can seem daunting when you do not know the exact step where the failure started. The table shows ten steps at which a failure occurred.

Because Sun Java System Application Server Plug-In uses the CLI tool asadmin to execute the command, you want to look for the native procedure sh step. Unfortunately, there are several steps with this name, two of which produced failure. The step of interest is the highest nested level where the native procedure failed. In the Nested Level column, the highest nested level shown where failure occurred is 7 (the 11th step).

To display more information about this step, click the Failed link in the Status column. A window opens with two boxes: stderr and stdout, as shown in the following figure.

Standard Out and Standard Error
Figure 65. Standard Out and Standard Error
Click here for a larger image.
 

The stdout box displays the output message that was produced by asadmin, and the stderr box displays the standard error message. In the stdout box, you can see that the standalone instance is not able to start because the node agent is not running. Fixing the problem involves finding out why the node agent cannot start.

Troubleshooting failures in Sun Java System Application Server Plug-In is not difficult when you know where to look for information about failures. When you know where to look, the process is usually straightforward.

Using N1SPS Plug-In With Existing Installations

You can use N1SPS Plug-In to provision and manage existing Application Server installations. N1SPS first has to discover the Application Server instances through a markOnly installation task. Use the procedure described in Provisioning of an Existing Installation of GlassFish v2 to manage these existing installations.

Summary

In this article you learned how to use N1SPS 6.0 Application Server Plug-In with the Sun N1 Service Provisioning System. The plug-in enables you to manage Sun Java System Application Server and GlassFish v2 individual and cluster instances through the N1 browser interface or through the command-line interface. The article presented examples of installations and management of Application Server, and tips for troubleshooting failure conditions in Sun Java System Application Server Plug-In.

References
Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Comments:
Your email address (no reply is possible without an address):
Sun Privacy Policy

Note: We are not able to respond to all submitted comments.
Jane Young Jane Young is an Engineer at Sun Microsystems. She has worked on the GlassFish command-line interface and N1 Service Provisioning System Application Server Plug-In.
 
Prashanth Abbagani Prashanth Abbagani is a Java EE Module Lead at Sun since 1999. He has contributed to Application Server Admin GUI, CLI framework, N1SPS Plug-In, Load Balancer administration, administrative infrastructure, and start-up time improvements.
 
Sreenivas Munnangi Sreenivas Munnangi has been a Java EE Module Lead at Sun since 2002. His key contributions include JSR77 Implementation, administrative infrastructure, add-on infrastructure, N1SPS Plug-In, and promotion of GlassFish adoption. He also owns the glassfish-samples open source project.
 
Rick PalkovicRajeshwar Patil is a member of Sun Java System Application Server development group. He has been with Sun since 2000, contributing to Application Server installation, assembly tool, Studio Plug-In, Netbeans Plug-In, Java EE support in Netbeans, N1SPS Plug-In, JES Monitoring Framework Plug-In, and Update Center.
 
Rick Palkovic Rick Palkovic is a staff writer for Sun Developer Network. He has written about the Solaris OS and Java technologies for longer than he likes to admit, composing everything from man pages to technical white papers.