Smooth redeployment of WAR in production?

前端 未结 6 1208
太阳男子
太阳男子 2021-02-20 05:53

I was wondering if there is a \'smooth way\' of redeploying a Java WAR to a production server (no cluster, no OSGi)?

All I can come up with is stop server, update file,

6条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-20 06:14

    First, hot-deploy doesn't always work. We spent so much time to make sure every new module is loaded and decided it's not worth the trouble. So what you are doing may sound bad but it's the most reliable way to deploy a new WAR.

    Our current approach is to use a switch with load-balancer in front of all servers. We run at least 2 instances of the application servers. When we shutdown one server for maintenance, the traffic automatically goes to the other one.

    Some of the switches are really inexpensive. If you don't have enough load to justify a new box and your 2 instances can run on the same box.

    In some circumstances, the switches can actually save money. For example, we have a SSL page that used to use 6 boxes and now it runs fine on 2 boxes with SSL acceleration in the switch.

提交回复
热议问题