当前位置:网站首页>On high availability architecture

On high availability architecture

2022-06-11 19:03:00 thoughtCodes

1、 The high availability architecture has characteristics
1、 Master slave switching or duplex
1) Master slave switch , When the service of one of the machines goes down , For the caller , Can quickly switch to other available services , Upgrade from service to main service , This switching speed should be controlled at the second level .

When the down time service is restored , Automatically become a slave service , Master / slave service role switching . The master-slave switch must pay a price , So when the main service is restored , It will not replace the existing main service .

2) Dual duplex mode ( Mutual support ) working principle : The two hosts run their own services at the same time and monitor each other , When any host goes down , The other host immediately takes over all its work , Make sure you work in real time , The key data of the application service system is stored in the shared storage system

2、 Cluster work

There are a lot of requests , A single service cannot meet the needs , At this time, multiple machines are required to provide the same service , Distribute all requests to different machines .

High availability architecture should have rich load balancing strategies and easy load adjustment methods .

It can even automate intelligent adjustment , For example, due to the performance of the machine , Response times may be different , At this time, you can distribute less to machines with poor performance , Ensure that the response time of each machine is balanced .

3、 Easy to expand horizontally
When there are more and more users , When an existing service cannot host more users , You need to extend the service , The best way to extend is not to touch the original service , Transparent to service callers .

2、 High availability solution
1、 database
One master, many followers , Read / write separation

2、nginx Load balancing
nginx Is a reverse proxy server , Have rich load balancing strategies , Used between client and server , As an implementation of load balancing .

Reverse proxy : The proxy is the server , That is, the client accesses a so-called server , The server will forward the request to the real server in the background , The real server responds , The result is returned to the client through the proxy server . Servers are hidden from users , The user does not know which server is the real server .

use nginx To achieve high availability of services ,nginx Itself may become a single point , Two solutions encountered ,

One is that the company builds its own DNS, Parse the request to a different NGINX,

One is cooperation keepalive Implement service survival detection . Here's the picture :

3、redis
1) Multi master multi slave mode , Three master and three slave cluster mode , Deployed on three servers

2) Pseudo cluster mode , You can also create a pseudo cluster with only one server , multi-node .

4、zookpeer
Same as redis

5、eureka
Same as redis

原网站

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