Page code on-line detailed

Source: Internet
Author: User
Tags svn update

1th Code Online early Manual deployment code

Pure manual SCP upload code.

Pure manual login, Git pull or svn update.

Pure manual xftp upload code.

Development send compressed package, RZ upload, unzip the deployment code.

Disadvantages:

Full Cheng participation, taking up a lot of time.

If there are many nodes, the line speed is slow.

A lot of human error, directory management confusion.

Rollback is not a time-out, or it is difficult to rewind.

1.1 Small company Code online case

1.1.1 Characteristics and problems

01. Release code anytime, anywhere, fast and timely

02. Development of published code is not tested, resulting in inaccessible (such as Dead Loop code), poor user experience on the site

1.1.2 Architecture Proposal (Project responsibility System)

01. Developers need to build LNMP environment [XAMPP One-click Integrated lamp package] in the PC to test the development of good site code, and in the office or IDC Room test environment test passed, preferably a full-time testers

02. program code on-line time, such as three days on-line, if the site needs to be updated frequently daily 17 o'clock in the afternoon on-line, this look at the nature of the website business, the principle is to affect the minimum user experience (the best user experience)

03. The code should be backed up before the launch, the website program has a problem for easy fallback; Upload the code as much as possible to the server site temporary directory, pass the full back one step mv past, or through ln to do soft links

04. Manage the line as much as possible, as developers are more concerned with the functionality of the code, and operations are more concerned about server stability. Therefore, the website down to the operation of the pipe to the maintenance of the line, or the development of random updates, the problem is responsible for operation, operation and maintenance will not be able to rise

1.2 Medium-sized company code on-line case

1.3 Large company code-on-line solutions

In particular, Java code environment, when on-line, several machines need to be updated as follows:

1) The local developer takes the SVN code. The same day on-line submitted to the trunk, otherwise, long-term project single open branch development, and then in the consolidated Main Line (trunk)

2) Office intranet Development Test, by the developer or Configuration Manager through the deployment platform Jenkins for unified deployment (that is, on the deployment platform control development machine from SVN fetch code, compile, package, publish to the development machine, package name such as Idc_dep.war)

3) The developer notifies or tests the program with the tester, and when there is no problem, the configuration administrator hits the new tag tag. Note here that the configuration files for different environments are published with the code at the same time.

4) Configure the administrator, according to the tag tag of the previous step, checkout out the line code, and configure all the configuration of the IDC test Environment, perform the compilation, packaging [Mvn,ant] (PHP does not need to be packaged), and then published to the unified distributor in IDC

5) Configure the Administrator or SA on-line personnel, push the distributed program code content to the relevant test server (package name such as Idc_test.war), and then notify the development and testing personnel to test. If there is a problem, go back and continue modifying

6) If the IDC test is not a problem, continue to play the tag tag, at this time, the configuration manager, according to the tag tag of the previous step, checkout out the test good code, and configure all the configuration of the IDC formal environment, perform the compilation, packaging [Mvn,ant] (PHP does not need to pack), Then publish to the unified Distributor host in IDC to prepare for bulk release

7) Configure the Administrator or SA on-line personnel, the content of the distribution to the relevant official server (package name such as Idc_product.war), and then notify the development and testing personnel to test, if there is a problem directly post rollback instructions

1.3.1 IDC official on-line process

IDC formally on-line process for the Java program, can be the AB group on-line idea, that is, smooth off half of the server, and then release the update code restart test, and then hang up the updated server, and then smooth off the other half of the server, and then release the update Code test (or directly post, restart, Hang on line)

1) on-line process, the Office test Environment-->IDC Test environment and the formal production environment, all the software in all environments should be version unified, second as far as possible, or else will endless. Successful development test, IDC test may have problems (such as operating system, Web server, Jdk,php,tomcat,resin and other versions)

2) Development Team Group Office Internal Test Environment test, code problems returned to a developer to re-develop

3) have a special test engineer, the program has a problem directly returned to the developer (at this time, the general program of the bug, known as the Bug Library), no problem for the IDC test

4) IDC test by the tester and operations personnel involved, called Idctest, to carry out the stress test of the program, there is a problem directly back to the developer, no problem in the online environment online.

5) Several server code distribution on-line scenario Example (Java program)

A: Assume that the same business Server has 6, the server is divided into a, b two groups, a group of three, Group B three, first to a group from the load balancer smooth offline, B group to provide services, to avoid the server due to the impact of the business.

B: The downline process is kicked out of a group a server from the RS pool (LVS,NGINX,HAPROXY,F5, etc.) through a script to avoid a negative equalizer sending the request to a group a server (at this time should be the site traffic, usually night)

C: Distribution of code to a group of servers in the site directory, a set of servers on-line and restart services, and by the professional testing personnel for access testing, test success, hang on a group of servers, while the offline Group B server, B set of code-on-line operation Test and a group of the same, while observing the server status of the online service , there are problems in time to roll back.

6) Special Note: If it is a PHP program, then the line can be simplified, directly to the full amount of online code published to all on-line server specific directory, after the distribution is complete, one-time MV or LN to the site directory, of course, testing is also indispensable. Testing in addition to personnel testing, there are a variety of test scripts to test the various relevant business interfaces

7) Most of the front-end pages of the portal have been static or cache, due to the dynamic part of the visit usually not particularly much

1.3.2 PHP Program code on-line specific scenarios

For PHP on-line method: When the Code is published (also need testing process) can be published directly to the official line temporary directory, and then MV or change the way link to publish to the official online directory, do not need to restart the HTTP service. This is the new Lang, the market on-line plan.

1.3.3 Java program code on-line specific scenarios

For the Java on-line approach: Larger companies need to group smooth on-line (such as from the load balancer to remove half of the server), after the release of the code, restart the server test, no problem, hang up half of the line, and then the other half. If the front-end DNS intelligent resolution, on-line can also be divided into several regional online servers, gradually spread to the country's servers, this is called "Grayscale publishing", in the back of the portal on-line knowledge we are explaining.

Reference https://mp.weixin.qq.com/s?__biz=MzAxOTE5NjQwOA==&mid=2650113445&idx=1&sn= ca4231f30a39872db9fb6893d5740d49&chksm= 83cb9532b4bc1c242bba69d52c96e188c43117c3c29fc9b47830e9d390514a3ff26f812e19a6&mpshare=1&scene=23& Srcid=0718al9luyse5splxbcntn7t#rd

This note is my study notes finishing, this is the first draft (there are many imperfections), original works allowed to reprint, please be sure to use hyperlinks in the form of the original source of the article, the author information and this statement, otherwise will be held liable. http://www.cnblogs.com/bananaaa/

Page code on-line detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.