Skip to main content

Deploying to a cluster with no downtime

10 replies [Last post]
dbsquared
Offline
Joined: 2009-08-03

I was wondering if it's possible to deploy to a cluster without taking the application down for a maintenance window. In our case we will likely have a hardware load balancer fronting the application so we could use 2 stand alone instances with the same application deployed where software deployments would go like this.
1. stop traffic to 1 instance from the LB
2. deploy the new application code to that instance and test
3. swap the instances in the LB and repeat
This of course does not take advantage of the Glassfish cluster features of config sharing and in-memory session replication. Can someone describe how you could achieve something like this using the cluster profile.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Vishal Mehra

Please see response inline.

On Fri, Aug 7, 2009 at 11:35 AM, wrote:

> Vishal, I'm not sure I understand your solution can I confirm a few things:
> When you Quiesce instanceA this leaves instanceB responding to client
> requests?
>

That's correct, instanceB would continue to accept and responds to client
requests.

are deploying to a cluster which contains InstanceA & InstanceB?

That's correct. All instances participating in a given cluster would
eventually get an update. In the scanerio under discussion, instanceB (and
other instances) would continue to work with AppVersion1 . Once instanceB is
quiesced and re-enabled, automatically, AppVersion2 is going to be deployed.
Hope this makes sense.

> When you do the deploy what prevents glassfish from pushing the application
> update to InstanceB?

Until the instance is bounced, new version of the app is not going to be
deployed on that instance.

> I don't see anything in the admin UI to control this. I'm not running the
> glassfish load balancer is that required for this to work?
> [Message sent by forum member 'dbsquared' (dbsquared)]
>
> http://forums.java.net/jive/thread.jspa?messageID=359476
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
[att1.html]

dbsquared
Offline
Joined: 2009-08-03

I see this http://docs.sun.com/app/docs/doc/820-4341/abdjj?a=view which indicates you require 2 clusters to support what I described which is really a shame. Having to manage 2 clusters with a total of 4 instances seems like a lot of management in order to achieve what I was looking for. I saw some posts on supporting application versions I hope this very common use case of upgrading an application is given a bit more thought in that feature.

whartung
Offline
Joined: 2003-06-13

What this is describing is exactly what you were describing, save that it uses "clusters" vs instances.

However, while obviously common, there is no requirement to have more that one instance per cluster. The "cluster" is a management component that covers one or more servers. So you can create two clusters of one instance each.

dbsquared
Offline
Joined: 2009-08-03

What's the benefit of the cluster then?

Vince.Power@medavie.bluecross.ca

I haven't found the real benefit of using clusters inside glassfish other
than it makes mapping targets easier when creating resources or deploying
applications.

If you have to configure multiple clusters to have no downtown during an
upgrade you might as well just skip clustering and configure multiple
standalone installs of GlassFish and just use a load-balanacing appliance
in front of your servers and just follow a loop of
Quiesce/redeploy/unQuiesce .

Rolling updates and being able to export a deployed EAR/WAR are two
features I miss now that I'm moving to GlassFish from WebSphere.

Regards,
Vince

From:
glassfish@javadesktop.org
To:
users@glassfish.dev.java.net
Date:
08/04/2009 02:41 PM
Subject:
Re: Deploying to a cluster with no downtime

What's the benefit of the cluster then?
[Message sent by forum member 'dbsquared' (dbsquared)]

http://forums.java.net/jive/thread.jspa?messageID=358829

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

-----------------------------------------------------------------------
This communication, including any attached documentation, is intended only for the person or entity to which it is addressed, and may contain confidential, personal, and/or privileged information. Any unauthorized disclosure, copying, or taking action on the contents is strictly prohibited. If you have received this message in error, please contact us immediately so we may correct our records. Please then delete or destroy the original transmission and any subsequent reply. Thank you.

La présente communication, y compris toute pièce qui y a été jointe, est destinée uniquement à la personne ou à l’entité à laquelle elle a été adressée, et contient des renseignements à caractère confidentiel et personnel. Toute diffusion ou reproduction non autorisée ou toute intervention entreprise relativement à son contenu est strictement interdite. Si vous avez reçu ce message par erreur, veuillez nous le signaler immédiatement afin que nous puissions effectuer la correction à nos dossiers. Veuillez par la suite supprimer ou détruire le contenu de la transmission originale ainsi que toute réponse ultérieure. Merci.
-----------------------------------------------------------------------
[att1.html]

Vishal Mehra

Hi Vince,

For compatible applications follow the steps below for rolling upgrade. GF
supports it even with a single cluster. If you need a script, I can forward
it you.

deploy AppVersion1
Start cluster

Enable dynamic LB
Quiesce instanceA
Deploy AppVersion2
start instanceA

repeat these steps for other instances (instanceX)
Quiesce instanceB
start instanceB
.....

--

--

*Vishal Mehra
*Expert Technologist
Sun Professional Services Delivery

*Sun Microsystems, Inc.*
Mobile 408-768-1929
Email vishal.mehra@Sun.COM

On Tue, Aug 4, 2009 at 10:51 AM, wrote:

> I haven't found the real benefit of using clusters inside glassfish other
> than it makes mapping targets easier when creating resources or deploying
> applications.
>
> If you have to configure multiple clusters to have no downtown during an
> upgrade you might as well just skip clustering and configure multiple
> standalone installs of GlassFish and just use a load-balanacing appliance in
> front of your servers and just follow a loop of Quiesce/redeploy/unQuiesce .
>
> Rolling updates and being able to export a deployed EAR/WAR are two
> features I miss now that I'm moving to GlassFish from WebSphere.
>
> Regards,
> Vince
>
>
>
> From:glassfish@javadesktop.orgTo:users@glassfish.dev.java.netDate:08/04/2009
> 02:41 PMSubject:Re: Deploying to a cluster with no downtime
> ------------------------------
>
>
>
> What's the benefit of the cluster then?
> [Message sent by forum member 'dbsquared' (dbsquared)]
>
> http://forums.java.net/jive/thread.jspa?messageID=358829
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>
>
> -----------------------------------------------------------------------
> This communication, including any attached documentation, is intended only
> for the person or entity to which it is addressed, and may contain
> confidential, personal, and/or privileged information. Any unauthorized
> disclosure, copying, or taking action on the contents is strictly
> prohibited. If you have received this message in error, please contact us
> immediately so we may correct our records. Please then delete or destroy the
> original transmission and any subsequent reply. Thank you.
>
> La présente communication, y compris toute pièce qui y a été jointe, est
> destinée uniquement à la personne ou à l’entité à laquelle elle a été
> adressée, et contient des renseignements à caractère confidentiel et
> personnel. Toute diffusion ou reproduction non autorisée ou toute
> intervention entreprise relativement à son contenu est strictement
> interdite. Si vous avez reçu ce message par erreur, veuillez nous le
> signaler immédiatement afin que nous puissions effectuer la correction à nos
> dossiers. Veuillez par la suite supprimer ou détruire le contenu de la
> transmission originale ainsi que toute réponse ultérieure. Merci.
> -----------------------------------------------------------------------
>
[att1.html]

dbsquared
Offline
Joined: 2009-08-03

Vishal, I'm not sure I understand your solution can I confirm a few things:
When you Quiesce instanceA this leaves instanceB responding to client requests?
When you Deploy AppVersion2 you are deploying to a cluster which contains InstanceA & InstanceB? When you do the deploy what prevents glassfish from pushing the application update to InstanceB? I don't see anything in the admin UI to control this. I'm not running the glassfish load balancer is that required for this to work?

cdonaldson
Offline
Joined: 2007-11-13

Everything that has been asked in this thread can be achieved with GF with quiescing. Please go through the entire doc link I sent. Failing that, this subsection from that page:

http://docs.sun.com/app/docs/doc/820-4341/abdgs?a=view

is "Upgrading In a Single Cluster" and deals with exactly what you want to achieve and provides every step for no downtime upgrades in 1 cluster with multiple instances.

Additional answers for the thread:

Yes, instance B continues to serve requests while instance A is being quiesced.

Yes, you are deploying AppVersion2 to the cluster containing Instances 1 & 2. You disable dynamic reconfiguration according to step 2 to manually determine when updates are pushed to the instances.

Steps are provided for the GF LB. If you are not using it, you need to substitute the appropriate steps for your LB.

You do not need multiple clusters to achieve this.

You can achieve a rolling upgrade.

cdonaldson
Offline
Joined: 2007-11-13

Hi,

It's called quiescing, and can be done at the application or instance (in a cluster) level. Check this out and let me know if that clears it up:

http://docs.sun.com/app/docs/doc/820-4341/abdgs?a=view

Regards,
Chris

dbsquared
Offline
Joined: 2009-08-03

Sorry my question is more about application deployment. If I install a web application via the admin-gui to a cluster how would I go about upgrading that application without downtime. Thanks for the quiescing docs but that talks about getting an instance out of the load balancer so once that's done I don't see a way to deploy a new .war to a single cluster instance. If the only option is to deploy the new .war to the cluster that implies there will be some period of downtime as the update will go both to the quiesced instance and the live instance which is receiving traffic? Is there a better way?