Thursday Jul 23, 2009

Centrally managing GlassFish Load Balancer configurations

Yesterday we delivered a webinar on setting up load balancing for GlassFish clusters: Make Applications Highly Available: Load Balancing GlassFish Clusters. I'll post a link to the replay when available.  The registration and attendance numbers were  pretty amazing, which tells me a couple of things:

  1. The community is either already using GlassFish Enterprise Server in production, or are considering to place it in production.
  2. The community would like to learn more about approaches to load balancing GlassFish deployments.

While GlassFish supports multiple load balancing approaches (hardware load balancers, mod_jk, and the GlassFish. We have been adding both marketing and engineering content in this area due to the amount of interest we are seeing (example).

One of the more interesting features of the GlassFish is the ability to automatically push out the load balancer configuration from the GlassFish Domain Administraton Console (DAS) to the GlassFish Load Balancer Plugin running in one or more remote web servers. Vivek demonstrated this feature during the webinar.  Because of time, we did not have to to demonstrate cluster setup/configuration or how to set up the secure communication channel between the plugin and the DAS.

First, you can set up a GlassFish high availability cluster, from download to validating the configuration, in under 10 minutes.  Of course, it takes a bit longer if you want to install a cluster across multiple hosts, but that's just boilerplate (s)ftp and time consuming.

To address the second point, setting up a secure communication channel, I thought I would double-click on that a bit and show you how to set it up. Again, this will be done on a single host, removing the boilerplate of FTPing the installer around.  The first step is to download the GlassFish Enterprise Server bits that include HADB (download url). This bundle also includes the load balancer plugin. Download the Sun GlassFish Enterprise Server v2.1 with HADB. I used the file-based installer during the demo instead of the package-based installer.

Side note - apologies for the webinar demo demons hitting the load balancer installation demo. For some reason the network was slow (GUI was updating too slowly), and the terminal was not refreshing properly, so I lost context of what screen I was on. Yes, I ran through the demo beforehand in the exact same way it was demo'd, 4 times without issues. Sigh.

Below is a script that will set up the secure connection between the DAS and the Sun Web Server to enable automated updates of the load balancer configuration. I've added documentation for each step.


#!/usr/bin/bash

#################################################################
# This script will set up the secure communication channel between
# the Sun Web Server and DAS for automated load balancer updates. It
# assumes that both the web server and DAS exist on the same
# box (hey, it's a DEMO ;-) )
#################################################################

#
# Top-level "HOME_DIRECTORY" variables. Examples are shown,
# replace variables with data that reflect your environment.
# Error checking of commands not shown :-/. Also note that
# in my demo, I put all bits under /var/tmp/demo directory.
#

WS_HOME=/var/tmp/demo/webserver7
JAVA_HOME=/usr/jdk/latest
DAS_DOMAIN=/var/tmp/demo/glassfish/domains/domain1

#
# Variables related to the web server configuration
#

WS_INSTANCE=https-my_webserver_instance.sun.com
SECURE_DAS_COMM_PORT=4443
LISTENER_NAME=http-listener-2

#
# Variables related to certificates. Because this is a demo, we will
# create a self-signed certificate.
#

CERT_NAME=ServerCert
CERT_ALIAS=s1as
CERT_EXPORT_FILE=/var/tmp/demo/etc/${CERT_ALIAS}.rfc

#
# Push any existing webserver configuration modifications, in case
# the load balancer was just installed in the webserver, for example
#

${WS_HOME}/bin/wadm \\
        deploy-config \\
        --user=admin \\
        --force ${WS_INSTANCE}

#
# Create a new HTTP listener to communicate with the GlassFish Domain
# Administration Server. This is the connection where the loadbalancer
# configuration changes will be pushed.
#

${WS_HOME}/bin/wadm \\
        create-http-listener \\
        --user=admin \\
        --server-name=${WS_INSTANCE} \\
        --default-virtual-server-name=${WS_INSTANCE} \\
        --listener-port=${SECURE_DAS_COMM_PORT} \\
        --config=${WS_INSTANCE} ${LISTENER_NAME}

#
# Create a self-signed certificate for demo or educational purposes. Typically
# a signed certificate will be installed for maximum security in production
#

${WS_HOME}/bin/wadm \\
        create-selfsigned-cert \\
        --user=admin \\
        --nickname=${CERT_NAME} \\
        --server-name=${WS_INSTANCE} \\
        --token=internal \\
        --config=${WS_INSTANCE}

#
# Set SSL property on the http listener used for DAS communication, using
# the certificate just defined
#
 
${WS_HOME}/bin/wadm \\
        set-ssl-prop \\
        --user=admin \\
        --http-listener=${LISTENER_NAME} \\
        --config=${WS_INSTANCE} \\
        enabled=true \\
        server-cert-nickname=${CERT_NAME}

#
# Export the DAS public key certificate stored in the Java keystore. Note that
# the Enterprise Profile (default for GlassFish w/HADB bundle) utilizes the
# NSS keystore, so this would be replaced with the equivalent certutil command.
#

${JAVA_HOME}/bin/keytool \\
        -export \\
        -rfc \\
        -alias ${CERT_ALIAS} \\
        -keystore ${DAS_DOMAIN}/config/keystore.jks \\
        -file ${CERT_EXPORT_FILE}

#
# Import the DAS public key certificate into the the certificate database,
# enabling a secure, trusted communication channel between the DAS and
# the web server.
#

${WS_HOME}/bin/certutil \\
        -A \\
        -a \\
        -n ${CERT_ALIAS} \\
        -t "TC" \\
        -i ${CERT_EXPORT_FILE} \\
        -d  ${WS_HOME}/admin-server/config-store/${WS_INSTANCE}/config/ 

#
# List the certificates in the web server certificate database
#

${WS_HOME}/bin/certutil \\
        -L \\
        -d ${WS_HOME}/admin-server/config-store/${WS_INSTANCE}/config 

#
# Push webserver configuration modifications to the instance
#

${WS_HOME}/bin/wadm \\
        deploy-config \\
        --user=admin \\
        --force ${WS_INSTANCE}



Tuesday Mar 24, 2009

Introducing the GlassFish Tools Bundle for Eclipse

For me, it's Ground Zero for EclipseCon, 2009.  I wanted to get an early start to post about the GlassFish Tools Bundle for Eclipse, but it looks like Ludo beat me to the punch.  I was slowed down a bit by the fact that I forgot to pack toothpaste, which does not exactly mash well with booth duty. No worries, the hotel lobby personnel had my back, so my breath is minty fresh :-)

Sooooo, Sun is announcing the GlassFish Tools Bundle for Eclipse, which bundles community editions of GlassFish v2.1 and GlassFish v3 Prelude, Eclipse 3.4 (with Web Tools Platform), GlassFish Eclipse plugin and optionally JDK 1.6.  In addition, we've included the Java EE Javadocs, so you get Java EE API auto-completion.

Here are some notes about the bundle I think are worthwhile to mention:

  • The GlassFish Tools Bundle for Eclipse v0.9.9 is not quite FCS yet. Great quality, but we have a few motions to go through for a 1.0 release.  We're doing everything we can to get to 1.0 as quickly as possible.

  • The GlassFish Tools Bundle for Eclipse is \*extending\* the reach of GlassFish into the Eclipse community. In the past, developers had to pull together too many pieces (above) to get an Eclipse-based GlassFish environment.

  • To preempt the tinfoil hats, GlassFish will continue to ship with the award winning NetBeans IDE. In fact, check out this video Adam Bien's presentation at Community One East on the NetBeans 6.7 with GlassFish v3 Prelude. 3 slides and a ton of code.

  • If you are interested in using GlassFish with Eclipse, the GlassFish Tools Bundle for Eclipse is the quickest way to get there.  Eclipse is pre-configured (err, pre-integrated) with GlassFish, including log file viewing, http monitor, and more.

  • With GlassFish v3 Prelude, Eclipse developers don't lose HTTP session state when their application is re-deployed. Developer lifecycle simplified to edit-save-refresh browser. Keeps your mind on the problem, not the tool!

  • With GlassFish v3 Prelude, developers get an early look at Java EE 6 APIs, including JSF 2.0 Early Access and EJB 3.1 Lite Early Access (both in the Update Center).  JAX-RS is final and fully supported (also in Update Center).

  • The GlassFish Tools Bundle for Eclipse supports Windows, Linux, and Mac OS X. No worries, OpenSolaris is coming.
I'd say that's a good first-take introduction to the bundle. Time to head off to the booth!

Saturday Sep 22, 2007

GlassFish V2: The start of something great

What a difference two weeks make. Two weeks ago I was pulling (what's left of) my hair out trying to get the T's crossed and the i's dotted on GlassFish before the Monday launch. Pre-and-post-launch I've have been talking to potential customers, the sales force, analysts and the press. The word is getting out and the feedback is extremely positive.

I can't help feel that this GlassFish launch is the start of something great. Yes, Sun has had an application server (in one form or another) for almost a decade. Yes, GlassFish V1 has been around for over a year - even in production. But it all seems to have come together with GlassFish V2. Grrreat performance. New cost-efficient subscriptions for support. Enterprise ready. Open source community. Fully Java EE 5 compatible. The value proposition is looking good.  Not to put ASCII in their HTML, but Gartner seems to agree.

As we, the community, move forward, I'll do my best to keep everyone abreast of GlassFish momentum. The message may not always come from The Clingan Zone, but I've got prolific friends :-)

Monday Sep 17, 2007

GlassFish V2 released with cost-efficient annual subscriptions

There is a good reason for the rather long pause at The Clingan Zone. As mentioned previously, I moved out of the field and into corporate as the GlassFish Group Product Manager. In that role, I have been working in the background doing my part to help move GlassFish V2 towards the goal line. As of today, we've crossed that line. GlassFish V2 is formally released!!

GlassFish V1, the first Java EE 5 application server available, focused on developers with Java EE 5 ease-of-development features, low resource consumption, dynamic resource configuration, etc.  GlassFish V2 adds out-of-the-box enterprise features. In particular:

  • Clustering - Cluster for scalability high-availability. New to GlassFish V2 is in-memory session replication for high availability; robust and easy to set up. For 5 9's of availability Sun continues to offer HADB.
  • Advanced administration - From a centralized GUI console (or  CLI) users can manage and monitor the clusters and applications. Clusters can be created and grown dynamically to meet user demand.
  • Best-in-class performance - GlassFish V2 offers great performance and is the fastest open source application server available. In fact, GlassFish V2 is 10% faster than BEA WebLogic 9.x on the same hardware (compare here and here).
  • Microsoft .NET 3.0 Web services Interoperability - At it's core,  Project Metro offers industry-leading web services performance with JAX-WS. In addition, Sun (through Project Metro) and Microsoft have worked together to ensure secure, reliable, transactional and high performance web services interoperability between Java EE and Microsoft .NET 3.0.

Enterprise features do not compromise ease-of-use. To date the feedback we have received on ease-of-use has been overwhelmingly positive, especially for clustered deployments. Ease-of-use will be a top-level theme for GlassFish V3 (more on that in a later post).

Sun's commercially available counterpart to GlassFish V2, the Sun Java System Application Server 9.1, is offered with new annual subscriptions for support, including live transfer for issues impacting production availability. In fact, we have dropped prices by up to 75% to be in line with other open source offerings. Yep, you can buy online. Note, GlassFish V2 is at feature parity with the Sun Java System Application Server 9.1 - we're not penalizing the open source community for committing to open source bits.  However, if production support is required to reduce the impact of production issues, we have your back. With great out-of-the-box enterprise features and cost-efficient pricing, the Sun Java System Application Server 9.1 offer a great value proposition whether you are an enterprise looking to drive down costs or a startup looking for a low barrier to entry.

Download GlassFish V2 or Sun's commercialized counterpart, the Sun Java System Application Server 9.1. Take it for a spin. Have questions? Check the documentation or the FAQ on how to get help.
 

About

John Clingan

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today