Best practices for deploying Java webapps with minimal downtime?

前端 未结 18 1864
我在风中等你
我在风中等你 2021-01-29 18:28

When deploying a large Java webapp (>100 MB .war) I\'m currently use the following deployment process:

  • The application .war file is expanded locally on the develop
18条回答
  •  心在旅途
    2021-01-29 18:39

    Just use 2 or more tomcat servers with a proxy over it. That proxy can be of apache/nignix/haproxy.

    Now in each of the proxy server there is "in" and "out" url with ports are configured.

    First copy your war in the tomcat without stoping the service. Once war is deployed it is automatically opened by the tomcat engine.

    Note cross check unpackWARs="true" and autoDeploy="true" in node "Host" inside server.xml

    It look likes this

      
    

    Now see the logs of tomcat. If no error is there it means it is up successfully.

    Now hit all APIs for testing

    Now come to your proxy server .

    Simply change the background url mapping with the new war's name. Since registering with the proxy servers like apache/nignix/haProxy took very less time, you will feel minimum downtime

    Refer -- https://developers.google.com/speed/pagespeed/module/domains for mapping urls

提交回复
热议问题