开发者

How to deploy the same application to multiple servers

开发者 https://www.devze.com 2023-04-04 21:40 出处:网络
looking for examples of what people have done inorder to deploy the same webapp or processes to multiple servers.

looking for examples of what people have done inorder to deploy the same webapp or processes to multiple servers. The deployment process right now consists of copying the sa开发者_如何学运维me file multiple times to different servers within our company. There has to be a better way to do this right now I am looking into ms build does anyone have other ideas? Thanks in advance.


Take a look at msdeploy and Web Deploy.


I've done this using a variety of methods. However, I think the best one is what I call a "rolling" deployment.

The following assumes a code only deployment:

Take one or more web servers "offline" by removing them from the load balancing list, let's call this group A. You should keep enough running to keep up with existing traffic, we'll call those group B. Push the code to the offline servers (group A).

Then, put group A back into rotation and pull group B out. Make sure the app is still functional with the new code. If all is good, update group B and put them back in rotation. In the event of a problem, just put group B back in and take A out again.

In the case of a database update there are other factors to consider. If you can take the whole site down for a limited period then do so and perform all necessary updates. This is by far the easiest.

However, if you can't then do a modified "rolling" deployment which requires multiple database servers. Pick a point in time and move a copy of the production database to the second one. Apply your changes. Then pull a group of web servers out, update their code to production and test. If all is good, put those web servers back into rotation and take out group B. Update the code on B while pointing them to the second DB server. Put them back into rotation.

Finally, apply all data changes that occurred on the primary production database to the secondary one.


Note, I don't use Web Deploy or MS Deploy for pushes to production. Quite frankly I want the files ready to be copy/pasted into the correct directory on the server so that the push can run as quickly as possible. Both Web and MS Deploy options involve transferring those files over a network connection; which is typically much slower than simply copy/pasting from one local directory to another.


You can build a simple console app that connects to a fixed sftp download, uncompress and run all the files in a fixed directory. A meta XML file can be usefull to create rules such as each machine will run each application, pre-requirements and so on.

You can also use dropbox api to download your files if you don't have a centralized server to unify your apps.


Have a look at kwateeSDCM. It's language and platform agnostic (Windows, Linux, Solaris, MacOS). There's an article dedicated to deployment of a webapp on multiple tomcat servers.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号