当前位置:网站首页>Microservices -- Opening

Microservices -- Opening

2022-07-04 22:27:00 Uncle meow

Since this article, we have entered the world of microservices , In the next few articles, we will learn some principles of microservice components , In order to understand the essence of micro service architecture .

One 、 Case study

There is a large mall system , Designed by different development languages 100 Multiple services make up , There is a calling relationship between most services , If you want to change the deployment of these services to microservice deployment , It is almost difficult to implement with a unified microservice framework . So it USES Nginx Manage these services , First get the address of the service to be called through the local configuration file , Then assemble the address into URL, After that, all calls between services pass Nginx agent .

Two 、 Problems of traditional architecture

The architecture described in the case is the traditional architecture , It has four problems .

2.1 Complicated configuration , Online error prone

Every time the system is deployed 、 Add services 、 Manual configuration is required when adding or removing machines Nginx, And every environment is different , Therefore, it is easy to make mistakes in configuration , Therefore, when the server changes or the network changes, you need to sort out each configuration , Then measure the ruler for many times to basically ensure that there is no problem , But if there is no detailed inspection or some load balancing nodes make mistakes, it is difficult to find .

2.2 Add the machine to restart

When the number of visits to the system increases , We need to add servers to some services , But because it needs to be configured manually Nginx, So if you don't pay attention, you will make mistakes , And once the system goes wrong, it will be restarted Nginx, If the restart fails, it will have a great impact . So we should add servers in a short time and ensure that the configuration is accurate , It's a difficult process .

2.3 Single point load balancing

All systems have to go through Nginx agent , therefore Nginx It's easy to become the bottleneck of the whole system , If Nginx There's something wrong with the configuration , Then all services will be unavailable . At this time, there must be a little partner who said that every service should have its own Nginx

原网站

版权声明
本文为[Uncle meow]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207042153257936.html