|
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
- On the left side of the browser interface page, click Manage Applications.
- Select the Applications node.
- In the right pane, click the Plans tab.
- Under the Plans tab, click RemoveSystemServicePlan.
Figure 3. Selecting
Applications Node and Plans Tab
Click here for
a larger image. |
- To run the plan, you must create a Variable Set for the plan, as described
in the following steps.
- Click the Variable Set tab in the right pane.
- Click New Variable Set. The New Variable Set wizard opens.
- Step through the wizard to create a new variable set and close the
wizard.
- Click Run Plan.
- After the plan has run, you can remove Application Server Plug-In, as
described in the following steps.
- On the left side of the page, click Manage Applications.
- In the right pane, click the Application Server check box.
- Click Delete.
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.
- In the left pane, under Applications, click Manage Applications.
- 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.
- Click Import Application to import the Application Server Plug-In.
- Prepare hosts by selecting all the remote agents under Manage Hosts in
the left pane.
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.
The following steps install Application Server from the N1 browser interface.
- Expand the tree in the left pane under Manage Applications to expose
the Application Server node. Select the Installation Tasks node.
- In the right pane, click Install.
Figure 4. Installation
Tasks |
- 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.
Figure 5. Variable
Set
Click here for
a larger image. |
- 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.
- Click Save to save the variable set.
- Select the Target Host, the remote agent machine on which you want to
install the Application Server.
- Click Run to install the Application Server on selected target hosts.
The progress bar shows you when the installation is complete.
- Verify the installation by opening the View Activity Log, in which you
can view all the executed plans.
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.
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.
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.
- Expand the tree in the left pane under Manage Applications until you
have expanded the Application Server node.
Figure 6. Choosing
markOnly Installation Task |
- Select Installation Tasks in the left pane, and click Install (markOnly)
in the right pane. The page of run options opens.
- In the run options page, click Select Host and choose the target host
(the machine on which Application Server is installed).
- In the Component Variables section of the run options page, click Edit
Variable Set. The Variable Sets page opens.
- Click New Variable Set. The New Variable Set wizard opens.
- 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.
Figure 7. Variable
Set for markOnly Task
Click here for
a larger image. |
- 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.
- 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 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.
Figure 8. Domain
Admin Server Infrastructure Tasks |
The following examples show how to create and delete a domain.
The Domain Admin Server > Create task enables you to create a domain.
- Click the Create button. A page of run options opens, as shown in the
following figure.
Figure 9. Run
Options for Creating a Domain
Click here for
a larger image. |
- 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.
- 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.
Figure 10. Variable
Set for Creating a Domain
Click here for
a larger image. |
- 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.
- Click Save to store your changes.
- After you have created a new variable set, click Run. You will see the
result when the create domain plan is finished.
The Domain Admin Server > Delete task enables you to delete a domain.
- Click the Delete button to open a page like the one shown in the following
figure.
Figure 11. Selecting
a Host for Deleting a Domain |
- Select the domain virtual host from which to delete the domain.
Figure 12. Run
Options for Deleting a Domain
Click here for
a larger image. |
- Click Run Selected Installation. The page of run options opens, as shown
in the following figure.
Figure 13. Deleting
the Domain
Click here for
a larger image. |
- Click Run. After the task has completed, the GUI shows success status.
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.
Figure 14. Cluster
Infrastructure Tasks |
Use the following procedure to create a cluster.
- From the Infrastructure Tasks page, click Cluster > Create to create
a cluster. The page of run options opens.
Figure 15. Run
Options for Creating a Cluster
Click here for
a larger image. |
- 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.
- Before you can create a cluster, you must create a new variable set.
From the run options page, click Edit Variable Set.
- 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.
Figure 16. A
New Variable Set for Creating a Cluster
Click here for
a larger image. |
- Click Save to store your changes.
The Cluster > Delete task enables you to delete a cluster.
- Click the Delete button to open a page like the one shown in the following
figure.
Figure 17. Selecting
a Host From Which to Delete a Cluster |
- Select the virtual host of the cluster, which appears in the list.
- Click Run Selected Installation. A page like the one shown in the following
figure opens.
Figure 18. Deleting
a Cluster
Click here for
a larger image. |
- Click Run. After the task has completed, the GUI shows success status.
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.
Figure 19. Node
Agent Infrastructure Tasks |
- From the Infrastructure Tasks page, click Node Agent > Create to create
a node agent. A page of run options opens.
Figure 20. Run
Options for Creating Node Agent
Click here for
a larger image. |
- 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.
- Before you can create a node agent, you must create a new variable set.
From the run options page, click Edit Variable Set.
- Click New Variable Set. The New Variable Set page opens.
- 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.
Figure 21. New
Variable Set for Creating Node Agent
Click here for
a larger image. |
- Click Save to store your changes.
- Click Run to create the node agent on the selected installation. After
the task has completed, the GUI shows run status.
The Node Agent > Delete task enables you to delete a node agent.
- Click the Delete button to open a page like the one shown in the following
figure.
Figure 22. Deleting
a Node Agent
Click here for
a larger image. |
- Select the virtual host of the node agent, which appears in the list.
- 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 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.
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.
The Cluster Instance > Create task enables you to create a clustered instance.
- 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.
Figure 24. Run
Options for Creating a Clustered Instance
Click here for
a larger image. |
- 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.
- In the run options page, click Edit Variable Set. A page like the one
shown in the following figure opens.
Figure 25. Editing
Variables
Click here for
a larger image. |
- 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.
- Save your changes, then click Run to run the plan.
The Delete Instance > Delete task enables you to delete a clustered instance.
- From the N1 GUI, click the Cluster Instance > Delete button.
- 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.
Figure 26. Deleting
a Clustered Instance |
- Click Run. The GUI displays the status of the run after it is completed.
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.
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
- In the N1SPS GUI, click Manage Plans and Components on the left side
of the page, then click the Folders tab on the right.
Figure 27. Creating
a New Folder
Click here for
a larger image. |
- Click New Folder. The New Folder Wizard opens.
- 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
- 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.
- Select the Application Tasks node in the tree to display the Application
Tasks pane on the right.
Figure 28. Application Tasks
Click here for
a larger image. |
- Click Create Application Component. The New Component Wizard page opens,
as shown in the following figure.
- 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/.
Figure 29. New Component Wizard
Click here for
a larger image. |
- Click Next to advance to the next step.
- Specify the file source by specifying server name and deployment application
archive details.
- 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.
- In the N1 GUI, click Manage Plans and Components from the left navigation
menu. The following figure illustrates steps 1–3.
Figure 30. Viewing Components in a Folder
Click here for
a larger image. |
- In the directory tree, click the Deploy folder.
- Click the Components tab on the right side of the page and take note
of the deploy component you have created.
- Click the deploy component, then click on the Variable Sets tab.
- Click New Variable Set to open the New Variable Set wizard, as shown in
the following figure.
- Type a name for the new variable set and click Save. In the example, the
name is
hello_app.
Figure 31. New
Variable Set Wizard
Click here for
a larger image. |
- In the N1 browser interface page, click the Procedures tab on the right.
- Select the install:default checkbox to enable deployment of the application.
- Click Run Procedure, and specify the required host identifying information.
Figure 32. Providing
Host Information
Click here for
a larger image. |
- 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.
Figure 33. Verifying Successful Deployment
Click here for
a larger image. |
To undeploy the application that was deployed in the previous example, perform
the following steps:
- In the N1 GUI, click Manage Plans and Components from the left navigation
menu.
- Click the folder in which the deploy component is located.
- Select the component you want to undeploy.
- From the N1 GUI, click the Procedures tab.
- Check the uninstall:default box and select the application host.
- Click Run Selected Installation. A page opens showing the run option.
Figure 34. Undeploying an Application
Click here for
a larger image. |
- 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.
Figure 35. Verifying Successful Undeployment
Click here for
a larger image. |
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.
Figure 36. Load
Balancer Plug-In Infrastructure Tasks |
- In the N1 GUI, click Infrastructure Tasks in the left pane.
- Click Install under Load Balancer Plug-In on the right pane. A page of
run options like the one shown below opens.
Figure 37. Installing
Load Balancer Plug-In |
- Click Select Host and choose the target hosts, the machines on which you
want to install the Load Balancer Plug-In.
- 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).
Figure 38. Variable
Set for Load Balancer Plug-In Installation |
- 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.
This procedure uninstalls an existing Load Balancer Plug-In.
- In the N1 GUI left pane, click Infrastructure Tasks.
- In the right pane, under Load Balancer Plug-In, click Uninstall. The
browser displays the page shown below.
Figure 39. Selecting
Hosts for Load Balancer Plug-In Uninstallation |
- Select the machine locations of the Load Balancer you want to uninstall
from the list of Component Installed Locations.
- Click Run Selected Installation. A page like the one shown below opens
to display run options.
Figure 40. Setting
Run Options for Load Balancer Plug-In Uninstallation
Click here for
a larger image. |
- Click Run to uninstall the Load Balancer plug-in from the hosts you selected
in step 3.
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.
Figure 41. HADB
Infrastructure Tasks |
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:
- In the N1 GUI, click Infrastructure Tasks in the left pane.
- Under HADB in the right pane, click Install. A page opens (see below)
in which you set run options for the task.
Figure 42. Setting
Run Options for Installing HADB
Click here for
a larger image. |
- Click Select Host and choose the target hosts, the machine(s) on which
you want to install HADB.
- 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).
Figure 43. Variable
Set for HADB Installation
Click here for
a larger image. |
- Click Save to store your work.
- 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.
To uninstall HADB:
- Click Infrastructure Tasks in the left pane.
- Under HADB in the right pane, select Uninstall. You will see a page like
the one shown below.
Figure 44. Identifying
an HADB to Uninstall |
- 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.
Figure 45. Run
Options for HADB Uninstallation
Click here for
a larger image. |
- Click Run to uninstall the HADB from the selected hosts.
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.
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.
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.
- Determine the current value corresponding to maximum heap size JVM Options
using the Admin Console.
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).
- 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.
- Select Other Tasks under the Application Server node on
the left, and click Remote Command in the right pane.
Figure 48. Selecting
Remote Command
Click here for
a larger image. |
- A page opens (see below) in which you set run options
for the task. Click Select Host and specify values for Target Host.
Figure 49. Run
Options for Remote Command
Click here for
a larger image. |
- Click Edit Variable Set, then New Variable Set. Define
a new variable set called
delete_heap_512m.
Figure 50. New
Variable Set for Deleting Heap Option |
- Click Save, then Run in the main page.
- 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.
- Select Other Tasks under the Application Server node on the left,
and click Remote Command in the right pane.
- Click Select Host and provide values for Target Host.
- Click Edit Variable Set, then New Variable Set. Define a new variable
set called
create_heap_1024m.
Figure 51. New
Variable Set for Creating Heap Option |
- Click Save, then Run in the main page.
- 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.
Figure 52. Verifying
New Variable Value |
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.
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.
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 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
|
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
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
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.
|
Rajeshwar 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 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.
|
|