Tuesday Oct 23, 2007

Troubleshooting Application Server Plugin in N1SPS

Sun Java System Application Server Plugin is very useful if you want to manage GlassFish Application Server in the enterprise system.   But when something goes wrong, how do you debug the plugin?  In this entry I will tell you how to troubleshoot Application Server Plugin execution in N1SPS.

There are two types of execution in the plugin:  preflight and deployment.  The preflight  simulates the plan execution. Although preflight always happens before a deployment, you can run a plan that is only a preflight.  The preflight captures failures like if the host is prepared and if required variables are set and if it's valid.  The deployment executes the component's install, uninstall and control procedures. 

Let's take a look at a preflight failure.  The preflight failures are easy to spot (see figure below).   From the message, it says that "appName cannot be null".  appName is a variable name and is required. 

 Click on the "Error Log" tab.  Error Log provides a list of hosts and steps that failed during the preflight and deployment phases of the plan. For each host, you have the option to view more information by clicking "Step Failed".  In the figure below, the "Context" column tells you that it failed in "preflight".

The "Run Results" tab provides you details in stepwise execution. 

From the "Run Results", you can easily spot that the failure is in Preflight.   The failure started in "lock host".  Click on the "lock host" link and "Step Status" is displayed.

Next, click on "View" in "Sub Steps Status".  A popup window is displayed with the Sub Steps Execution Summary.

From the Sub Steps Execution Summary, you can view the exact component execution.  The failure started in the control procedure called "validate".  This control checks for the variable appName and if it's null, raise an error.  

Now, let's take a look at a deployment failure.  In this example, I'm trying to start a standalone instance and I get a plan execution failure with the message:  "Error: unable to start instance."


The "Error Log" tab tells you that the failure came from Plan execution which is deployment.  The "Step Failed" link doesn't give too much information about where the failure is propagated.  So let's take a look at the "Run Results" tab to get a detailed step wise summary.


 In the "Run Results" tab, you can see that the failure is in Deployment execution.  The failure is in control procedure called "start". 

In the "Step Name" column, click on the link of the "control server: 'start'":

 To get more details, click on the link, "View" under Sub Steps Status column.  A popup window is displayed with the detailed component execution.

Looking at this table can be overwhelming since you may not know the exact step where the failure started.  Since Sun Java System Application Server Plugin uses the CLI tool, "asadmin" to execute the command, you want to look for the "native procedure sh".  But there are few native procedures.  The key is to look for the highest  nested level  where the native procedure failed.  In this case, the highest nested level is "7" (the 11th steps).  Click on the "Failed" link in the Status column.   A popup window with two boxes: stderr and stdout is displayed:

 The stdout box displays the exact output message from "asadmin" and stderr box displays the standard error message.  From the stdout box, you can see that the standalone instance is not able to start because the Node Agent is not running.

 Troubleshooting failures in Sun Java System Application Server Plugin is not difficult.  You just have to know where to look for the failures.  Once you get the hang of where to look for the failures, it's a straight forward process.

For additional resources, please refer to Application Server N1SPS Plugin - Blogs and Resources.

Friday Oct 05, 2007

Using N1SPS in GlassFish V2 Enterprise Environment

Now that GlassFish V2 has launched, you are able to setup an enterprise environment website where you can create cluster of instances on multiple hosts.  Websites such as shopping carts, auctions, financial institution, health care and others rely on an enterprise setup to support scalability, load-balancing, fail over protection and high availability.   Surely, you don't want your site to crash and there are no backups or sessions persistence.  And of course, you want your site to be load-balanced so that if there are thousands of requests, customers are not waiting at your site to load.  Furthermore, if you want to setup a production and development systems, you want to be able to replicate the enterprise environment on a separate domain running on separate machines. 

A typical enterprise setup looks somewhat like this (click to enlarge image):


Where the color boxes represent domains and the outlined boxes represent the machines.  Missing from the diagram is the node-agents.  Each machine that has a server instance will require installation of a node-agent.
Adding load-balancer and HADB to the diagram:

where WebServer is installed on separate machine to load balance clustered instances and High Availability Database (HADB) is installed on another machine to provide high availability. 

In a data center, you may have hundred of machines and the machines may spread across many geographic locations.   As you can imagine, managing this enterprise setup can be very challenging and complex. 

GlassFish V2's administration console provides a very good web console to manage and administer domain.  However, if you have multiple domains, you'll need to login to multiple administration consoles.  Likewise, using GlassFish V2 CLI, you'll need to know the user name, password, host name and port number for each domain.

This is where N1 Service Provisioning System (N1SPS)  comes to the rescue. 

N1SPS is the solution to enterprise environment complexity by offering  deployment of multi-tier applications across heterogeneous platforms from one console.

And, you can get N1SPS for FREE!


So how do you use N1SPS with GlassFish V2?

First let me give a brief overview of how N1SPS works.  N1SPS is distributed software platform that includes the following special-purpose applications you install on the servers in your network. These applications interact to allow you to deploy software to the servers in your network.

  • Master Server – A central server that provides an interface for managing application deployments.
  • Remove 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 – Optional servers that act as a proxy for the Master Server to optimize network communications across data centers and through firewalls.

There is a Sun Java System Application Server Plugin (available soon for FREE as well) that gets imported to N1SPS Master Server which allows you to do the following:

  • Installation of Sun Java System Application Server
  • Domain Management 
  • Node Agent Management 
  • Instance Management 
  • Cluster Management 
  • Application Deployment 
  • Installation of Load Balancer Plugin 
  • Installation of HADB Server and Client 
  • Resource Configuration

The plugin supports GlassFish V2 productized distribution, Sun Java System Application Server 9.1 as well as  Sun Java System Application Server 8.2 (which is part of Java Enterprise System 5) and 8.1 (which is part of Java Enterprise System 4).   Download Sun Java System Application Server 9.1 with HADB here.

You will need to install a Remote Agent for each machine that will have Application Server, WebServer and HADB installed. 

Here's an overview of how the setup looks like:


With this setup, you'll be able to administrator an enterprise system with multiple domains/node-agents/clusters/server instances with software load-balancer and HADB installed on multiple machines from one administration console and CLI.

Here's more blogs on N1SPS and Sun Java System Application Server Plugin:




« June 2016

No bookmarks in folder