0

I'm trying to deploy my MEANjs application into production...
So far I've use jenkins, git,rsync, etc. to copy the project to the remote server.

and in the final step I just have to call

  1. stop myMeanjsApp
  2. Replace the folder with the new version of the application
  3. Call start myMeanjsApp

but that would mean a downtime which I'm trying to avoid so
1. how can I avoid this?
2. Are there any good practice work-flows for this ?

I've seen this but I'm not sure if its the way to go or is there any other simple way of doing this?

yokodev
  • 1,266
  • 2
  • 14
  • 28

1 Answers1

0

Typically a large scale web application is upgraded by creating new virtual machines running an upgraded version of the software. The new virtual machines are then added to the load balancer (manually or automatically). Then the virtual machines running the old version are removed from the load balancer pool and when all in-progress requests to the old vms are done, the vms can be destroyed. E.g. AWS features like ELB and auto scaling groups makes this an attractive way to upgrade software.

You could do the same even if you have a single server by starting the new version into a different port.

The naught npm module is fair approach if you must replace the code in-place.

For some applications it might be an option to simply stop accepting new connections and restart with the new version when the last connection is done.

And for some applications you can just kill the old version and start new version at any time. It all depends on your requirements and environment.

sti
  • 11,047
  • 1
  • 27
  • 27