tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Zero downtime deployments
Date Fri, 04 Dec 2015 18:19:56 GMT
Kevin,

On 12/3/15 2:21 PM, Kevin Hale Boyes wrote:
> Thanks for this link to the presentation.
> How do you all deal with some of the other dependencies that the web
> application has?
> 
> For example, if v2 of my application needs new database columns or worse, a
> change to an existing column how can I have v1 and v2 running at the same
> time?  We use Oracle as our database though the problem exists for many
> database servers.

That's not a deployment problem. That's a design problem.

In short, you need to make sure that your web application is both
forward-compatible and backward-compatible at the same time.

That's rubbish, or course. Here's a more concrete suggestion, and it
requires a LOT of work, but it's worth it.

First of all, you can't think of a release as a single event any more.
Instead, there are 4 events.

First, there is the pre-release release. That's where you release a
small upgrade to your previous version that is forward-compatible with
the release you really want to perform. For instance, you make sure that
none of your database queries will bomb if you have additional fields in
your database tables. You also have to make sure that the release won't
bomb if the /new/ structure is *not* in place. That may require you to
do a few temporary hacks.

Second, you perform your database upgrade. No code release is involved,
here. Remember that if you want zero-downtime, you have to be careful
about modifying tables that contain data. Most databases can handle
online ALTER statements, but they can take a looooong time if you have a
lot of data. During that loooong time, your users may be blocked
(waiting!) for access to the data in those tables. If you can't afford
for that to happen, you'll have to make other arrangements.

Third, you release your new version.

Fourth, you clean-up any hacks you may have left in from the Second
Step. This may require another small release, and it may also require
another small database modification (for instance, removing a now-unused
field from a table). If you are doing a small-enough release in the
Third Step, then this may not even be necessary at all.

Hope that helps,
-chris

> On 3 December 2015 at 01:31, Neill Lima <neill.lima@visual-meta.com> wrote:
> 
>> Hello Jason,
>>
>> This approach of using httpd in front of 2+ Tomcats via AJP works well in
>> my company. There is a bit of config necessary at httpd level so httpd is
>> aware of all the Tomcats and also Tomcat config needs to be set to listen
>> to AJP port instead of default port but it is not rocket science.
>>
>> This facilitates the deployment of nodes sequentially with no downtime. Of
>> course, there is a shared session server to take care the sessions are not
>> lost when Tomcats flip up and down.
>>
>> Reply in pvt if you need help setting up this.
>>
>> Thanks,
>>
>> Neill
>>
>> On Thu, Dec 3, 2015 at 12:08 AM, Jason Britton <jbritton31@gmail.com>
>> wrote:
>>
>>> Thank you Christopher, reading now and we'll see if I can swing the
>>> conference :)
>>>
>>> On Wed, Dec 2, 2015 at 4:00 PM, Christopher Schultz <
>>> chris@christopherschultz.net> wrote:
>>>
>>>> Jason,
>>>>
>>>> On 12/2/15 4:07 PM, Jason Britton wrote:
>>>>> I was looking for information for how those on the list achieve zero
>>>>> downtime deployments of their tomcat hosted web applications.  I
>>> imagine
>>>>> this can be achieved in a variety of ways, but would love to hear
>> what
>>>>> works for you.  In our current environment we front multiple tomcat
>>>>> instances with apache httpd, each tomcat instance hosting one or more
>>>>> unique web apps.  In order to support this effort we do have the
>>>> resources
>>>>> where we could spin up multiple tomcat instances to serve requests
>> for
>>> a
>>>>> single application.  I know there is mod_proxy_balancer available for
>>>>> httpd, and I understand starting with tomcat 7 there is support for
>>>>> parallel deployment of versioned wars, and tomcat also supports
>>>>> clustering.  I'm just unsure of what approach I should start digging
>>> into
>>>>> and would very much appreciate any of your experiences.  The servers
>>>> we'll
>>>>> be rolling out will be using the latest versions of tomcat 8 and
>> apache
>>>>> httpd 2.4.  Thanks for any insights!
>>>>
>>>> Check this out:
>>>>
>>>>
>>>
>> http://people.apache.org/~schultz/ApacheCon%20NA%202015/Load-balancing%20Tomcat%20with%20mod_jk.pdf
>>>>
>>>> Start on slide/page 41.
>>>>
>>>> Then come to ApacheCon NA 2016 and discuss it!
>>>>
>>>> -chris
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message