In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
In general, to upgrade a server-side application, you need to upload the application source code or package to the server, then stop the old version of the service, and then start the new version. However, this simple release method has two problems. On the one hand, the service is temporarily interrupted during the upgrade process of the new version, on the other hand, if the new version has BUG, the upgrade fails, and it is also very troublesome to roll back, which can easily cause the service to be unavailable for a longer time.
In order to solve these problems, people have developed a variety of release strategies, which we will introduce one by one below.
Blue and green deployment
The so-called blue-green deployment refers to applications running two versions at the same time. As shown in the figure above, blue-green deployment does not stop the old version, but directly deploys a new version. After the new version is running, the traffic is switched to the new version. However, blue-green deployment requires that two sets of programs be run at the same time during the upgrade process, which requires twice as much hardware as is required on a daily basis. For example, if you need 10 servers to support your business during daily operation, you will need to purchase 20 servers.
Scroll publish
Rolling release can solve the problem of doubling hardware requirements in blue and green deployment.
The so-called rolling upgrade means that during the upgrade process, you do not start all the new versions at once, but start a new version first, then stop an old version, then start a new version, and then stop an old version until the upgrade is completed. In this way, if 10 servers are needed every day, only 11 are needed in the upgrade process.
However, there is a problem with the rolling upgrade. After the rolling upgrade is started, the traffic will flow directly to the new version that has already been started, but at this time, the new version is not necessarily available, for example, further testing is needed to confirm. Then during the rolling upgrade, the whole system is in a very unstable state, and if a problem is found, it is more difficult to determine whether it is caused by the new version or the old version.
In order to solve this problem, we need to implement flow control capabilities for rolling upgrades.
Grayscale release
Grayscale release, also known as canary release, originated when mine workers found that canaries are very sensitive to gas, and the miners will put a canary into the well before going down the mine. If the canary stops barking, it means the gas concentration is high.
After the grayscale release starts, start a new version of the application, but not directly cut the traffic, but the testers test the new version online, and the new version of the app launched is our canary. If there is no problem, you can import a small amount of user traffic to the new version, and then observe the running status of the new version and collect all kinds of run-time data. If you compare the data between the new version and the old version at this time, it is the so-called Amax B test.
When it is confirmed that the new version is working well, and then gradually import more traffic into the new version, during this period, you can constantly adjust the number of server replicas running between the new version and the old version, so that the new version can withstand more and more traffic pressure. Until 100% of the traffic is switched to the new version, and finally shut down the remaining old version of the service, complete the grayscale release.
If you find a problem with the new version during the grayscale release process (grayscale period), you should immediately switch the traffic back to the old version, so that the negative impact will be kept to a minimum.
Easy grayscale publishing using pulsed cloud
The deployment management of pulsed cloud can easily achieve the grayscale release with traffic management function mentioned above. Click Save after editing the application information normally, and then the pulse cloud will prompt for direct upgrade or grayscale release.
Direct upgrade is to use the general rolling upgrade. After clicking the grayscale release, you can manually intervene in the upgrade process and control the flow.
When you select grayscale publishing, the grayscale publishing control panel is displayed.
On this control panel, you can drag and drop the slider to quickly adjust the number of running copies of the new and old versions, and you can also import traffic to the new version as a percentage. In addition, you can specify the traffic of individual users to the new version by matching HTTP Header.
In addition to matching the HTTP request headers of user traffic, you can also directly specify the Cookie information in the matching request headers. Matching rules support exact matching, inclusion, regularity, prefixes, suffixes, and even reverse matching.
When you confirm that the new version is running correctly, you can click the finish upgrade button, which will switch all traffic to the new version and destroy all the old applications. If there is something wrong with the new version, you can click the cancel upgrade button to immediately switch the traffic back to the old version and destroy the new version of the application.
Summary
When the new version of the application is released, in order to upgrade the server without downtime, use the grayscale publishing strategy. At the beginning of the grayscale release, use HTTP Header to match the traffic of the specified testers to the new version, and then when the internal test of the new version passes, you can import the user traffic a little bit by percentage into the new version. For example, import 10% to observe the operation, and then import 20% to add up. Until all the traffic is imported into the new version, the upgrade is finally completed, and if a problem is found during the period, cancel the upgrade immediately and switch the traffic back to the old version.
With grayscale release, you no longer need to work overtime until late at night to downtime and upgrade, and you can release new versions boldly and safely during the day.
Reference DevOps platform: pulse Cloud Development platform
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.